home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: eng.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 64 6f 63 75 6d 65 6e | 74 73 74 79 6c 65 5b 66 |\documen|tstyle[f|
|00000010| 61 6e 63 79 68 65 61 64 | 69 6e 67 73 2c 74 77 6f |ancyhead|ings,two|
|00000020| 73 69 64 65 2c 65 70 73 | 66 2c 69 6e 64 65 6e 74 |side,eps|f,indent|
|00000030| 66 69 72 73 74 5d 7b 61 | 72 74 69 63 6c 65 7d 0a |first]{a|rticle}.|
|00000040| 25 20 56 65 72 74 69 63 | 61 6c 20 73 69 7a 65 73 |% Vertic|al sizes|
|00000050| 0a 25 5c 76 73 69 7a 65 | 3d 32 30 63 6d 0a 25 5c |.%\vsize|=20cm.%\|
|00000060| 76 6f 66 66 73 65 74 3d | 2d 32 2e 33 63 6d 0a 25 |voffset=|-2.3cm.%|
|00000070| 5c 74 6f 70 6d 61 72 67 | 69 6e 3d 30 63 6d 0a 25 |\topmarg|in=0cm.%|
|00000080| 5c 68 65 61 64 68 65 69 | 67 68 74 3d 30 2e 39 63 |\headhei|ght=0.9c|
|00000090| 6d 0a 25 5c 66 6f 6f 74 | 73 6b 69 70 3d 31 63 6d |m.%\foot|skip=1cm|
|000000a0| 0a 25 5c 66 6f 6f 74 68 | 65 69 67 68 74 3d 30 2e |.%\footh|eight=0.|
|000000b0| 39 63 6d 0a 25 5c 74 65 | 78 74 68 65 69 67 68 74 |9cm.%\te|xtheight|
|000000c0| 3d 31 36 63 6d 0a 25 5c | 68 65 61 64 72 75 6c 65 |=16cm.%\|headrule|
|000000d0| 77 69 64 74 68 20 30 2e | 30 31 63 6d 0a 25 5c 66 |width 0.|01cm.%\f|
|000000e0| 6f 6f 74 72 75 6c 65 77 | 69 64 74 68 20 30 2e 30 |ootrulew|idth 0.0|
|000000f0| 63 6d 0a 25 20 30 20 73 | 69 7a 65 73 0a 25 5c 68 |cm.% 0 s|izes.%\h|
|00000100| 73 69 7a 65 3d 33 30 63 | 6d 0a 25 5c 68 6f 66 66 |size=30c|m.%\hoff|
|00000110| 73 65 74 3d 2d 34 2e 33 | 63 6d 0a 25 5c 68 6f 66 |set=-4.3|cm.%\hof|
|00000120| 66 73 65 74 3d 2d 32 2e | 33 63 6d 09 0a 25 5c 74 |fset=-2.|3cm..%\t|
|00000130| 65 78 74 77 69 64 74 68 | 3d 31 33 63 6d 0a 25 20 |extwidth|=13cm.% |
|00000140| 4d 6f 64 65 73 0a 25 20 | 5c 73 70 65 63 69 61 6c |Modes.% |\special|
|00000150| 7b 6c 61 6e 64 73 63 61 | 70 65 7d 0a 5c 70 61 67 |{landsca|pe}.\pag|
|00000160| 65 73 74 79 6c 65 7b 65 | 6d 70 74 79 7d 0a 5c 70 |estyle{e|mpty}.\p|
|00000170| 61 67 65 73 74 79 6c 65 | 7b 66 61 6e 63 79 70 6c |agestyle|{fancypl|
|00000180| 61 69 6e 7d 0a 5c 6e 65 | 77 63 6f 6d 6d 61 6e 64 |ain}.\ne|wcommand|
|00000190| 7b 5c 74 69 74 7d 5b 31 | 5d 7b 23 31 7d 0a 5c 72 |{\tit}[1|]{#1}.\r|
|000001a0| 68 65 61 64 5b 5c 66 61 | 6e 63 79 70 6c 61 69 6e |head[\fa|ncyplain|
|000001b0| 7b 7d 7b 5c 74 69 74 7b | 5c 6c 65 66 74 6d 61 72 |{}{\tit{|\leftmar|
|000001c0| 6b 7d 7d 5d 7b 5c 66 61 | 6e 63 79 70 6c 61 69 6e |k}}]{\fa|ncyplain|
|000001d0| 7b 7d 7b 5c 74 69 74 7b | 5c 72 69 67 68 74 6d 61 |{}{\tit{|\rightma|
|000001e0| 72 6b 7d 7d 7d 0a 5c 6c | 68 65 61 64 5b 5c 66 61 |rk}}}.\l|head[\fa|
|000001f0| 6e 63 79 70 6c 61 69 6e | 7b 7d 7b 5c 74 69 74 7b |ncyplain|{}{\tit{|
|00000200| 5c 72 69 67 68 74 6d 61 | 72 6b 7d 7d 5d 7b 5c 66 |\rightma|rk}}]{\f|
|00000210| 61 6e 63 79 70 6c 61 69 | 6e 7b 7d 7b 5c 74 69 74 |ancyplai|n{}{\tit|
|00000220| 7b 5c 6c 65 66 74 6d 61 | 72 6b 7d 7d 7d 0a 5c 63 |{\leftma|rk}}}.\c|
|00000230| 68 65 61 64 7b 5c 68 66 | 69 6c 6c 7d 0a 5c 6c 66 |head{\hf|ill}.\lf|
|00000240| 6f 6f 74 5b 5c 66 61 6e | 63 79 70 6c 61 69 6e 7b |oot[\fan|cyplain{|
|00000250| 7d 7b 5c 74 69 74 7b 5c | 74 68 65 70 61 67 65 7d |}{\tit{\|thepage}|
|00000260| 7d 5d 7b 5c 66 61 6e 63 | 79 70 6c 61 69 6e 7b 7d |}]{\fanc|yplain{}|
|00000270| 7b 5c 68 66 69 6c 6c 7d | 7d 0a 5c 72 66 6f 6f 74 |{\hfill}|}.\rfoot|
|00000280| 5b 5c 66 61 6e 63 79 70 | 6c 61 69 6e 7b 7d 7b 5c |[\fancyp|lain{}{\|
|00000290| 68 66 69 6c 6c 7d 5d 7b | 5c 66 61 6e 63 79 70 6c |hfill}]{|\fancypl|
|000002a0| 61 69 6e 7b 7d 7b 5c 74 | 69 74 7b 5c 74 68 65 70 |ain{}{\t|it{\thep|
|000002b0| 61 67 65 7d 7d 7d 0a 5c | 63 66 6f 6f 74 7b 5c 68 |age}}}.\|cfoot{\h|
|000002c0| 66 69 6c 6c 7d 0a 5c 72 | 65 6e 65 77 63 6f 6d 6d |fill}.\r|enewcomm|
|000002d0| 61 6e 64 7b 5c 73 65 63 | 74 69 6f 6e 6d 61 72 6b |and{\sec|tionmark|
|000002e0| 7d 5b 31 5d 7b 5c 6d 61 | 72 6b 62 6f 74 68 7b 23 |}[1]{\ma|rkboth{#|
|000002f0| 31 7d 7b 5c 20 7d 7d 0a | 5c 72 65 6e 65 77 63 6f |1}{\ }}.|\renewco|
|00000300| 6d 6d 61 6e 64 7b 5c 73 | 75 62 73 65 63 74 69 6f |mmand{\s|ubsectio|
|00000310| 6e 6d 61 72 6b 7d 5b 31 | 5d 7b 5c 6d 61 72 6b 72 |nmark}[1|]{\markr|
|00000320| 69 67 68 74 7b 5c 20 7d | 7d 0a 5c 6e 65 77 63 6f |ight{\ }|}.\newco|
|00000330| 6d 6d 61 6e 64 7b 5c 6c | 6f 6f 6b 7d 5b 31 5d 7b |mmand{\l|ook}[1]{|
|00000340| 28 43 68 61 70 74 65 72 | 7e 5c 72 65 66 7b 23 31 |(Chapter|~\ref{#1|
|00000350| 7d 2c 20 70 61 67 65 7e | 5c 70 61 67 65 72 65 66 |}, page~|\pageref|
|00000360| 7b 23 31 7d 29 7d 0a 5c | 6e 65 77 63 6f 6d 6d 61 |{#1})}.\|newcomma|
|00000370| 6e 64 7b 5c 74 6f 69 6e | 64 65 78 7d 5b 31 5d 7b |nd{\toin|dex}[1]{|
|00000380| 5c 75 6e 64 65 72 6c 69 | 6e 65 7b 5c 62 66 23 31 |\underli|ne{\bf#1|
|00000390| 7d 5c 69 6e 64 65 78 7b | 23 31 7d 7d 0a 5c 6e 65 |}\index{|#1}}.\ne|
|000003a0| 77 63 6f 6d 6d 61 6e 64 | 7b 5c 61 64 64 7d 5b 31 |wcommand|{\add}[1|
|000003b0| 5d 7b 5c 73 79 6d 62 6f | 6c 7b 36 34 7d 7d 0a 5c |]{\symbo|l{64}}.\|
|000003c0| 6e 65 77 63 6f 6d 6d 61 | 6e 64 7b 5c 70 73 7d 5b |newcomma|nd{\ps}[|
|000003d0| 31 5d 7b 5c 73 79 6d 62 | 6f 6c 7b 33 37 7d 73 7d |1]{\symb|ol{37}s}|
|000003e0| 0a 5c 6e 65 77 63 6f 6d | 6d 61 6e 64 7b 5c 74 77 |.\newcom|mand{\tw|
|000003f0| 63 6f 6c 7d 5b 34 5d 7b | 0a 5c 6e 6f 69 6e 64 65 |col}[4]{|.\noinde|
|00000400| 6e 74 5c 70 61 72 62 6f | 78 5b 74 5d 7b 23 31 5c |nt\parbo|x[t]{#1\|
|00000410| 74 65 78 74 77 69 64 74 | 68 7d 7b 23 33 7d 20 5c |textwidt|h}{#3} \|
|00000420| 68 66 69 6c 6c 20 5c 70 | 61 72 62 6f 78 5b 74 5d |hfill \p|arbox[t]|
|00000430| 7b 23 32 5c 74 65 78 74 | 77 69 64 74 68 7d 7b 23 |{#2\text|width}{#|
|00000440| 34 5c 68 66 69 6c 6c 7d | 5c 5c 0a 7d 0a 5c 6e 65 |4\hfill}|\\.}.\ne|
|00000450| 77 63 6f 6d 6d 61 6e 64 | 7b 5c 74 63 7d 5b 32 5d |wcommand|{\tc}[2]|
|00000460| 7b 5c 74 77 63 6f 6c 7b | 30 2e 34 39 7d 7b 30 2e |{\twcol{|0.49}{0.|
|00000470| 34 39 7d 7b 23 31 7d 7b | 23 32 7d 7d 0a 5c 6e 65 |49}{#1}{|#2}}.\ne|
|00000480| 77 63 6f 6d 6d 61 6e 64 | 7b 5c 74 63 63 7d 5b 32 |wcommand|{\tcc}[2|
|00000490| 5d 7b 5c 74 77 63 6f 6c | 7b 30 2e 34 39 7d 7b 30 |]{\twcol|{0.49}{0|
|000004a0| 2e 34 39 7d 7b 5c 74 6f | 69 6e 64 65 78 7b 23 31 |.49}{\to|index{#1|
|000004b0| 7d 7d 7b 23 32 7d 7d 0a | 5c 6e 65 77 63 6f 6d 6d |}}{#2}}.|\newcomm|
|000004c0| 61 6e 64 7b 5c 74 74 74 | 7d 5b 32 5d 7b 5c 62 69 |and{\ttt|}[2]{\bi|
|000004d0| 67 73 6b 69 70 0a 0a 7b | 5c 62 66 23 31 7d 0a 0a |gskip..{|\bf#1}..|
|000004e0| 23 32 7d 0a 5c 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b |#2}.\new|command{|
|000004f0| 5c 74 73 7d 5b 31 5d 7b | 7b 5c 75 6e 64 65 72 6c |\ts}[1]{|{\underl|
|00000500| 69 6e 65 7b 5c 62 66 23 | 31 7d 7d 7d 0a 5c 6e 65 |ine{\bf#|1}}}.\ne|
|00000510| 77 63 6f 6d 6d 61 6e 64 | 7b 5c 64 6c 7d 5b 32 5d |wcommand|{\dl}[2]|
|00000520| 7b 5c 70 61 72 62 6f 78 | 5b 74 5d 7b 30 2e 34 5c |{\parbox|[t]{0.4\|
|00000530| 74 65 78 74 77 69 64 74 | 68 7d 7b 23 31 5c 68 66 |textwidt|h}{#1\hf|
|00000540| 69 6c 6c 7d 5c 68 66 69 | 6c 6c 0a 20 20 20 20 20 |ill}\hfi|ll. |
|00000550| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 5c | | \|
|00000560| 70 61 72 62 6f 78 5b 74 | 5d 7b 30 2e 34 5c 74 65 |parbox[t|]{0.4\te|
|00000570| 78 74 77 69 64 74 68 7d | 7b 23 32 5c 68 66 69 6c |xtwidth}|{#2\hfil|
|00000580| 6c 7d 7d 0a 5c 6d 61 6b | 65 69 6e 64 65 78 0a 5c |l}}.\mak|eindex.\|
|00000590| 62 65 67 69 6e 7b 64 6f | 63 75 6d 65 6e 74 7d 20 |begin{do|cument} |
|000005a0| 0a 5c 74 69 74 6c 65 7b | 5c 62 66 5c 69 74 20 4c |.\title{|\bf\it L|
|000005b0| 49 42 46 54 50 20 55 73 | 65 72 27 73 20 67 75 69 |IBFTP Us|er's gui|
|000005c0| 64 65 7d 0a 5c 61 75 74 | 68 6f 72 7b 4f 6c 65 67 |de}.\aut|hor{Oleg|
|000005d0| 20 4f 72 65 6c 7d 0a 5c | 64 61 74 65 7b 5c 74 6f | Orel}.\|date{\to|
|000005e0| 64 61 79 7d 0a 5c 6e 65 | 77 70 61 67 65 0a 5c 6d |day}.\ne|wpage.\m|
|000005f0| 61 6b 65 74 69 74 6c 65 | 0a 0a 5c 73 65 63 74 69 |aketitle|..\secti|
|00000600| 6f 6e 2a 7b 4c 49 43 45 | 4e 53 45 7d 0a 0a 54 68 |on*{LICE|NSE}..Th|
|00000610| 69 73 20 6c 69 62 72 61 | 72 79 20 69 73 20 64 65 |is libra|ry is de|
|00000620| 73 69 72 65 64 20 66 6f | 72 20 66 72 65 65 2c 20 |sired fo|r free, |
|00000630| 6e 6f 6e 2d 63 6f 6d 6d | 65 72 63 69 61 6c 20 73 |non-comm|ercial s|
|00000640| 6f 66 74 77 61 72 65 20 | 63 72 65 61 74 69 6f 6e |oftware |creation|
|00000650| 2e 20 0a 49 74 20 69 73 | 20 63 68 61 6e 67 65 61 |. .It is| changea|
|00000660| 62 6c 65 20 61 6e 64 20 | 63 61 6e 20 62 65 20 69 |ble and |can be i|
|00000670| 6d 70 72 6f 76 65 64 2e | 20 54 68 65 20 61 75 74 |mproved.| The aut|
|00000680| 68 6f 72 20 77 6f 75 6c | 64 20 67 72 65 61 74 6c |hor woul|d greatl|
|00000690| 79 20 61 70 70 72 65 63 | 69 61 74 65 20 0a 61 6e |y apprec|iate .an|
|000006a0| 79 20 61 64 76 69 73 65 | 73 2c 20 6e 65 77 20 63 |y advise|s, new c|
|000006b0| 6f 6d 70 6f 6e 65 6e 74 | 73 20 61 6e 64 20 70 61 |omponent|s and pa|
|000006c0| 74 63 68 65 73 20 6f 66 | 20 74 68 65 20 65 78 69 |tches of| the exi|
|000006d0| 73 74 69 6e 67 20 70 72 | 6f 67 72 61 6d 73 2e 0a |sting pr|ograms..|
|000006e0| 43 6f 6d 6d 65 72 63 69 | 61 6c 20 75 73 61 67 65 |Commerci|al usage|
|000006f0| 20 69 73 20 61 6c 73 6f | 20 70 6f 73 73 69 62 6c | is also| possibl|
|00000700| 65 20 77 69 74 68 20 70 | 61 72 74 69 63 69 70 61 |e with p|articipa|
|00000710| 74 69 6f 6e 20 6f 66 20 | 69 74 27 73 20 61 75 74 |tion of |it's aut|
|00000720| 68 6f 72 2e 0a 0a 5c 73 | 65 63 74 69 6f 6e 2a 7b |hor...\s|ection*{|
|00000730| 49 4e 54 52 4f 44 55 43 | 54 49 4f 4e 7d 0a 0a 54 |INTRODUC|TION}..T|
|00000740| 68 65 20 62 61 73 69 63 | 20 6f 72 69 65 6e 74 61 |he basic| orienta|
|00000750| 74 69 6f 6e 20 6f 66 20 | 74 68 69 73 20 6c 69 62 |tion of |this lib|
|00000760| 72 61 72 79 20 69 73 20 | 6d 61 6b 69 6e 67 20 75 |rary is |making u|
|00000770| 73 65 72 27 73 20 70 72 | 6f 67 72 61 6d 73 20 77 |ser's pr|ograms w|
|00000780| 68 69 63 68 20 74 72 61 | 6e 73 70 6f 72 74 0a 66 |hich tra|nsport.f|
|00000790| 69 6c 65 73 20 76 69 61 | 20 54 43 50 2f 49 50 20 |iles via| TCP/IP |
|000007a0| 6e 65 74 77 6f 72 6b 2e | 20 49 74 20 63 6f 6e 74 |network.| It cont|
|000007b0| 61 69 6e 73 20 73 65 74 | 20 6f 66 20 66 75 6e 63 |ains set| of func|
|000007c0| 74 69 6f 6e 73 2c 20 73 | 74 61 72 74 69 6e 67 20 |tions, s|tarting |
|000007d0| 66 72 6f 6d 20 70 72 69 | 6d 69 74 69 76 65 2c 20 |from pri|mitive, |
|000007e0| 73 75 63 68 20 61 73 20 | 0a 6f 70 65 6e 69 6e 67 |such as |.opening|
|000007f0| 20 46 54 50 20 63 6f 6e | 6e 65 63 74 69 6f 6e 20 | FTP con|nection |
|00000800| 74 6f 20 74 68 65 20 73 | 65 72 76 65 72 2c 20 61 |to the s|erver, a|
|00000810| 6e 64 20 66 69 6e 69 73 | 68 69 6e 67 20 62 79 20 |nd finis|hing by |
|00000820| 68 69 67 68 2d 6c 65 76 | 65 6c 20 66 75 6e 63 74 |high-lev|el funct|
|00000830| 69 6f 6e 73 2c 20 73 75 | 63 68 20 61 73 20 66 75 |ions, su|ch as fu|
|00000840| 6e 63 74 69 6f 6e 73 20 | 77 68 69 63 68 20 72 65 |nctions |which re|
|00000850| 74 72 69 65 76 65 20 66 | 69 6c 65 73 0a 20 76 69 |trieve f|iles. vi|
|00000860| 61 20 6e 65 74 77 6f 72 | 6b 2c 20 6d 61 6b 69 6e |a networ|k, makin|
|00000870| 67 20 61 6e 64 20 63 6c | 6f 73 69 6e 67 20 63 68 |g and cl|osing ch|
|00000880| 61 6e 6e 65 6c 73 20 74 | 6f 20 74 68 65 20 73 65 |annels t|o the se|
|00000890| 72 76 65 72 2e 20 41 6c | 6c 20 66 75 6e 63 74 69 |rver. Al|l functi|
|000008a0| 6f 6e 73 20 68 61 76 65 | 20 0a 70 72 6f 74 6f 74 |ons have| .protot|
|000008b0| 79 70 65 73 20 69 6e 20 | 63 6f 6d 6d 6f 6e 20 68 |ypes in |common h|
|000008c0| 65 61 64 65 72 20 66 69 | 6c 65 20 6e 61 6d 65 64 |eader fi|le named|
|000008d0| 20 5c 74 6f 69 6e 64 65 | 78 7b 46 74 70 4c 69 62 | \toinde|x{FtpLib|
|000008e0| 72 61 72 79 2e 68 7d 2c | 20 0a 77 68 69 63 68 20 |rary.h},| .which |
|000008f0| 6d 75 73 74 20 62 65 20 | 0a 61 76 61 69 6c 61 62 |must be |.availab|
|00000900| 6c 65 20 69 6e 20 73 74 | 61 6e 64 61 72 64 20 68 |le in st|andard h|
|00000910| 65 61 64 65 72 73 20 64 | 69 72 65 63 74 6f 72 79 |eaders d|irectory|
|00000920| 2e 20 54 68 6f 73 65 20 | 70 72 6f 74 6f 74 79 70 |. Those |prototyp|
|00000930| 65 73 20 61 6c 6d 6f 73 | 74 20 66 75 6c 6c 79 20 |es almos|t fully |
|00000940| 0a 64 65 73 63 72 69 62 | 65 20 6f 72 69 65 6e 74 |.describ|e orient|
|00000950| 61 74 69 6f 6e 20 61 6e | 64 20 61 72 67 75 6d 65 |ation an|d argume|
|00000960| 6e 74 73 20 6f 66 20 61 | 6c 6c 20 66 75 6e 63 74 |nts of a|ll funct|
|00000970| 69 6f 6e 73 2c 20 62 75 | 74 20 63 6f 6d 6d 6f 6e |ions, bu|t common|
|00000980| 20 69 64 65 6f 6c 6f 67 | 79 20 61 6e 64 20 6c 69 | ideolog|y and li|
|00000990| 62 72 61 72 79 20 63 6f | 6d 70 6f 6e 65 6e 74 73 |brary co|mponents|
|000009a0| 20 73 68 6f 75 6c 64 20 | 62 65 20 6d 65 6e 74 69 | should |be menti|
|000009b0| 6f 6e 65 64 2e 20 0a 0a | 54 68 69 73 20 6c 69 62 |oned. ..|This lib|
|000009c0| 72 61 72 79 20 69 73 20 | 61 20 63 6c 69 65 6e 74 |rary is |a client|
|000009d0| 20 61 6e 64 20 75 73 65 | 73 20 73 74 61 6e 64 61 | and use|s standa|
|000009e0| 72 64 20 46 54 50 44 20 | 66 72 6f 6d 20 74 68 65 |rd FTPD |from the|
|000009f0| 20 6f 74 68 65 72 20 73 | 69 64 65 2e 0a 0a 54 68 | other s|ide...Th|
|00000a00| 65 72 65 20 61 72 65 20 | 70 72 6f 62 6c 65 6d 73 |ere are |problems|
|00000a10| 20 6f 66 20 65 72 72 6f | 72 73 20 70 72 6f 63 65 | of erro|rs proce|
|00000a20| 73 73 69 6e 67 20 69 6e | 20 55 4e 49 58 20 69 6e |ssing in| UNIX in|
|00000a30| 63 6c 75 64 69 6e 67 20 | 69 6e 70 75 74 2f 6f 75 |cluding |input/ou|
|00000a40| 74 70 75 74 20 65 72 72 | 6f 72 73 2e 20 0a 54 68 |tput err|ors. .Th|
|00000a50| 65 20 6d 75 74 75 61 6c | 20 6d 65 63 68 61 6e 69 |e mutual| mechani|
|00000a60| 73 6d 20 6f 66 20 76 61 | 6c 75 65 20 72 65 74 75 |sm of va|lue retu|
|00000a70| 72 6e 69 6e 67 20 6f 66 | 20 61 6c 6c 20 66 75 6e |rning of| all fun|
|00000a80| 63 74 69 6f 6e 73 20 69 | 73 20 75 73 65 64 20 69 |ctions i|s used i|
|00000a90| 6e 20 74 68 69 73 20 6c | 69 62 72 61 72 79 2e 0a |n this l|ibrary..|
|00000aa0| 28 45 58 49 54 20 6d 61 | 63 72 6f 73 2c 20 64 65 |(EXIT ma|cros, de|
|00000ab0| 66 69 6e 65 64 20 69 6e | 20 66 69 6c 65 20 46 74 |fined in| file Ft|
|00000ac0| 70 4c 69 62 72 61 72 79 | 2e 68 29 2e 20 54 68 69 |pLibrary|.h). Thi|
|00000ad0| 73 20 6d 65 63 68 61 6e | 69 73 6d 20 61 6c 6c 6f |s mechan|ism allo|
|00000ae0| 77 73 2c 0a 20 61 66 74 | 65 72 20 74 68 65 20 64 |ws,. aft|er the d|
|00000af0| 65 66 69 6e 69 74 69 6f | 6e 20 6f 66 20 74 68 65 |efinitio|n of the|
|00000b00| 20 65 72 72 6f 72 20 70 | 72 6f 63 65 73 73 69 6e | error p|rocessin|
|00000b10| 67 20 66 75 6e 63 74 69 | 6f 6e 73 2c 20 77 72 69 |g functi|ons, wri|
|00000b20| 74 65 20 70 72 6f 67 72 | 61 6d 73 2c 20 0a 63 6f |te progr|ams, .co|
|00000b30| 6e 73 69 64 65 72 69 6e | 67 20 74 68 65 20 63 6f |nsiderin|g the co|
|00000b40| 6e 64 69 74 69 6f 6e 73 | 20 74 6f 20 62 65 20 69 |nditions| to be i|
|00000b50| 64 65 61 6c 2e 0a 44 61 | 74 61 20 74 72 61 6e 73 |deal..Da|ta trans|
|00000b60| 66 65 72 20 66 75 6e 63 | 74 69 6f 6e 73 20 68 61 |fer func|tions ha|
|00000b70| 76 65 20 70 6f 73 73 69 | 62 69 6c 69 74 79 20 74 |ve possi|bility t|
|00000b80| 6f 20 70 72 65 73 65 74 | 20 64 61 74 61 20 73 74 |o preset| data st|
|00000b90| 72 65 61 6d 20 65 78 70 | 65 63 74 61 74 69 6f 6e |ream exp|ectation|
|00000ba0| 20 74 69 6d 65 6f 75 74 | 2e 0a 57 68 65 6e 20 74 | timeout|..When t|
|00000bb0| 68 65 20 73 65 74 20 74 | 69 6d 65 20 65 78 70 69 |he set t|ime expi|
|00000bc0| 72 65 73 2c 20 70 72 65 | 76 69 6f 75 73 6c 79 20 |res, pre|viously |
|00000bd0| 73 65 74 20 66 75 6e 63 | 74 69 6f 6e 20 77 69 6c |set func|tion wil|
|00000be0| 6c 20 62 65 20 63 61 6c | 6c 65 64 2e 0a 0a 54 68 |l be cal|led...Th|
|00000bf0| 65 20 66 69 72 73 74 20 | 66 75 6e 63 74 69 6f 6e |e first |function|
|00000c00| 2c 20 77 68 69 63 68 20 | 73 68 6f 75 6c 64 20 62 |, which |should b|
|00000c10| 65 20 63 61 6c 6c 65 64 | 20 66 6f 72 20 77 6f 72 |e called| for wor|
|00000c20| 6b 20 77 69 74 68 20 6c | 69 62 72 61 72 79 20 69 |k with l|ibrary i|
|00000c30| 73 20 46 74 70 43 6f 6e | 6e 65 63 74 20 6f 72 20 |s FtpCon|nect or |
|00000c40| 46 74 70 4c 6f 67 69 6e | 2e 20 0a 54 68 65 79 20 |FtpLogin|. .They |
|00000c50| 6d 61 6b 65 20 63 6f 6e | 6e 65 63 74 69 6f 6e 20 |make con|nection |
|00000c60| 74 6f 20 46 54 50 20 73 | 65 72 76 65 72 20 61 6e |to FTP s|erver an|
|00000c70| 64 20 72 65 74 75 72 6e | 20 70 6f 69 6e 74 65 72 |d return| pointer|
|00000c80| 20 74 6f 20 46 54 50 20 | 64 61 74 65 20 73 74 72 | to FTP |date str|
|00000c90| 75 63 74 75 72 65 2e 20 | 20 0a 0a 0a 5c 73 65 63 |ucture. | ...\sec|
|00000ca0| 74 69 6f 6e 7b 54 68 65 | 20 46 54 50 20 64 61 74 |tion{The| FTP dat|
|00000cb0| 61 20 73 74 72 75 63 74 | 75 72 65 7d 0a 0a 0a 5c |a struct|ure}...\|
|00000cc0| 74 63 7b 69 6e 74 20 5c | 74 6f 69 6e 64 65 78 7b |tc{int \|toindex{|
|00000cd0| 73 6f 63 6b 7d 7d 7b 2d | 2d 2d 20 64 65 73 63 72 |sock}}{-|-- descr|
|00000ce0| 69 70 74 6f 72 20 6f 66 | 20 61 20 63 6f 6d 6d 61 |iptor of| a comma|
|00000cf0| 6e 64 20 63 68 61 6e 6e | 65 6c 20 74 6f 20 74 68 |nd chann|el to th|
|00000d00| 65 20 73 65 72 76 65 72 | 3b 7d 0a 5c 74 63 7b 46 |e server|;}.\tc{F|
|00000d10| 49 4c 45 20 2a 5c 74 6f | 69 6e 64 65 78 7b 64 61 |ILE *\to|index{da|
|00000d20| 74 61 7d 7d 7b 2d 2d 2d | 20 70 6f 69 6e 74 65 72 |ta}}{---| pointer|
|00000d30| 20 74 6f 20 64 61 74 61 | 20 73 74 72 75 63 74 75 | to data| structu|
|00000d40| 72 65 2c 20 77 68 69 63 | 68 20 64 65 73 63 72 69 |re, whic|h descri|
|00000d50| 62 65 73 20 64 61 74 61 | 20 63 68 61 6e 6e 65 6c |bes data| channel|
|00000d60| 20 74 6f 20 74 68 65 20 | 73 65 72 76 65 72 3b 7d | to the |server;}|
|00000d70| 0a 5c 74 63 7b 69 6e 74 | 20 5c 74 6f 69 6e 64 65 |.\tc{int| \toinde|
|00000d80| 78 7b 65 72 72 6e 6f 7d | 7d 7b 20 2d 2d 2d 20 6c |x{errno}|}{ --- l|
|00000d90| 61 73 74 20 72 65 74 75 | 72 6e 65 64 20 76 61 6c |ast retu|rned val|
|00000da0| 75 65 2e 20 57 68 65 6e | 20 76 61 6c 75 65 20 69 |ue. When| value i|
|00000db0| 73 20 6c 6f 77 65 72 20 | 74 68 61 6e 20 31 2c 20 |s lower |than 1, |
|00000dc0| 61 6e 20 65 72 72 6f 72 | 20 6f 63 63 75 72 72 65 |an error| occurre|
|00000dd0| 64 3b 7d 0a 5c 74 63 7b | 63 68 61 72 20 5c 74 6f |d;}.\tc{|char \to|
|00000de0| 69 6e 64 65 78 7b 6d 6f | 64 65 7d 7d 7b 2d 2d 2d |index{mo|de}}{---|
|00000df0| 20 74 79 70 65 20 6f 66 | 20 74 72 61 6e 73 66 65 | type of| transfe|
|00000e00| 72 3b 7d 0a 5c 74 63 7b | 69 6e 74 20 63 68 7d 7b |r;}.\tc{|int ch}{|
|00000e10| 2d 2d 2d 20 68 65 6c 70 | 20 76 61 72 69 61 62 6c |--- help| variabl|
|00000e20| 65 2e 20 49 73 20 75 73 | 65 64 20 74 6f 20 63 6f |e. Is us|ed to co|
|00000e30| 6e 76 65 72 74 20 41 53 | 43 49 49 20 66 69 6c 65 |nvert AS|CII file|
|00000e40| 73 3b 7d 0a 5c 74 63 7b | 53 54 41 54 55 53 20 28 |s;}.\tc{|STATUS (|
|00000e50| 2a 66 75 6e 63 29 28 29 | 7d 7b 2d 2d 2d 20 20 70 |*func)()|}{--- p|
|00000e60| 6f 69 6e 74 65 72 20 74 | 6f 20 61 6e 20 65 72 72 |ointer t|o an err|
|00000e70| 6f 72 20 68 61 6e 64 6c | 65 72 2e 20 49 74 20 69 |or handl|er. It i|
|00000e80| 73 20 63 61 6c 6c 65 64 | 20 0a 20 20 20 20 20 20 |s called| . |
|00000e90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000ea0| 20 77 68 65 6e 20 73 74 | 61 74 75 73 20 66 72 6f | when st|atus fro|
|00000eb0| 6d 20 74 68 65 20 73 65 | 72 76 65 72 20 69 73 20 |m the se|rver is |
|00000ec0| 62 61 64 3b 7d 0a 5c 74 | 63 7b 53 54 41 54 55 53 |bad;}.\t|c{STATUS|
|00000ed0| 20 28 2a 64 65 62 75 67 | 29 28 29 7d 7b 2d 2d 2d | (*debug|)()}{---|
|00000ee0| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 61 20 64 65 | pointer| to a de|
|00000ef0| 62 75 67 20 68 61 6e 64 | 6c 65 72 2e 20 49 73 20 |bug hand|ler. Is |
|00000f00| 63 61 6c 6c 65 64 20 66 | 72 6f 6d 20 20 0a 20 20 |called f|rom . |
|00000f10| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000f20| 20 20 20 20 20 20 66 75 | 6e 63 74 69 6f 6e 73 20 | fu|nctions |
|00000f30| 6f 66 20 73 65 6e 64 69 | 6e 67 2f 72 65 63 65 69 |of sendi|ng/recei|
|00000f40| 76 69 6e 67 20 6d 65 73 | 73 61 67 65 73 20 74 6f |ving mes|sages to|
|00000f50| 2f 66 72 6f 6d 20 73 65 | 72 76 65 72 3b 7d 0a 5c |/from se|rver;}.\|
|00000f60| 74 63 7b 53 54 41 54 55 | 53 20 28 2a 49 4f 29 28 |tc{STATU|S (*IO)(|
|00000f70| 29 7d 7b 2d 2d 2d 20 70 | 6f 69 6e 74 65 72 20 74 |)}{--- p|ointer t|
|00000f80| 6f 20 49 6e 70 75 74 2f | 4f 75 74 70 75 74 20 65 |o Input/|Output e|
|00000f90| 72 72 6f 72 20 68 61 6e | 64 6c 65 72 2e 20 49 73 |rror han|dler. Is|
|00000fa0| 20 63 61 6c 6c 65 64 20 | 77 68 65 6e 20 63 68 61 | called |when cha|
|00000fb0| 6e 6e 65 6c 20 74 6f 20 | 73 65 72 76 65 72 20 69 |nnel to |server i|
|00000fc0| 73 20 62 72 6f 6b 65 6e | 2e 7d 0a 0a 5c 73 65 63 |s broken|.}..\sec|
|00000fd0| 74 69 6f 6e 7b 20 43 6f | 6e 6e 65 63 74 69 6f 6e |tion{ Co|nnection|
|00000fe0| 2f 44 69 73 63 6f 6e 6e | 65 63 74 69 6f 6e 20 77 |/Disconn|ection w|
|00000ff0| 69 74 68 20 73 65 72 76 | 65 72 7d 0a 0a 5c 74 74 |ith serv|er}..\tt|
|00001000| 74 7b 53 54 41 54 55 53 | 20 5c 74 6f 69 6e 64 65 |t{STATUS| \toinde|
|00001010| 78 7b 46 74 70 43 6f 6e | 6e 65 63 74 7d 28 46 54 |x{FtpCon|nect}(FT|
|00001020| 50 7e 2a 2a 2c 20 63 68 | 61 72 7e 2a 68 6f 73 74 |P~**, ch|ar~*host|
|00001030| 6e 61 6d 65 0a 5c 66 6f | 6f 74 6e 6f 74 65 7b 54 |name.\fo|otnote{T|
|00001040| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 68 |he name |of the h|
|00001050| 6f 73 74 20 6d 61 79 20 | 62 65 20 73 79 6d 62 6f |ost may |be symbo|
|00001060| 6c 69 63 20 28 66 6f 72 | 20 65 78 61 6d 70 6c 65 |lic (for| example|
|00001070| 20 5c 74 73 7b 64 78 63 | 65 72 6e 2e 63 65 72 6e | \ts{dxc|ern.cern|
|00001080| 2e 63 68 7d 29 20 6f 72 | 20 6e 75 6d 65 72 69 63 |.ch}) or| numeric|
|00001090| 20 28 66 6f 72 20 65 78 | 61 6d 70 6c 65 20 5c 74 | (for ex|ample \t|
|000010a0| 73 7b 31 32 38 2e 31 34 | 31 2e 32 30 31 2e 39 36 |s{128.14|1.201.96|
|000010b0| 7d 29 7d 0a 29 7d 0a 7b | 0a 20 20 4d 61 6b 65 73 |})}.)}.{|. Makes|
|000010c0| 20 63 68 61 6e 6e 65 6c | 20 74 6f 20 74 68 65 20 | channel| to the |
|000010d0| 73 65 72 76 65 72 2c 20 | 61 74 20 74 68 65 20 60 |server, |at the `|
|000010e0| 60 68 6f 73 74 6e 61 6d | 65 27 27 20 6d 61 63 68 |`hostnam|e'' mach|
|000010f0| 69 6e 65 2e 0a 20 20 43 | 72 65 61 74 65 73 20 46 |ine.. C|reates F|
|00001100| 54 50 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |TP data |structur|
|00001110| 65 20 61 6e 64 20 72 65 | 74 75 72 6e 73 20 70 6f |e and re|turns po|
|00001120| 69 6e 74 65 72 20 74 6f | 20 69 74 2e 20 49 66 20 |inter to| it. If |
|00001130| 74 68 65 20 70 72 6f 63 | 65 64 75 72 65 20 5c 74 |the proc|edure \t|
|00001140| 6f 69 6e 64 65 78 7b 46 | 74 70 6c 69 62 44 65 62 |oindex{F|tplibDeb|
|00001150| 75 67 7d 28 31 29 0a 77 | 61 73 20 70 72 65 76 69 |ug}(1).w|as previ|
|00001160| 6f 75 73 6c 79 20 63 61 | 6c 6c 65 64 2c 20 5c 74 |ously ca|lled, \t|
|00001170| 73 7b 46 74 70 43 6f 6e | 6e 65 63 74 7d 20 63 61 |s{FtpCon|nect} ca|
|00001180| 6c 6c 73 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c |lls auto|maticall|
|00001190| 79 20 5c 74 73 7b 46 74 | 70 44 65 62 75 67 7d 20 |y \ts{Ft|pDebug} |
|000011a0| 66 6f 72 20 74 68 65 20 | 5c 74 73 7b 64 65 62 75 |for the |\ts{debu|
|000011b0| 67 20 6d 6f 64 65 7d 20 | 74 6f 20 62 65 20 74 75 |g mode} |to be tu|
|000011c0| 72 6e 65 64 20 6f 6e 2e | 20 0a 20 20 5c 6c 6f 6f |rned on.| . \loo|
|000011d0| 6b 7b 64 65 62 75 67 7d | 2e 0a 7d 0a 5c 74 74 74 |k{debug}|..}.\ttt|
|000011e0| 7b 53 54 41 54 55 53 20 | 5c 74 6f 69 6e 64 65 78 |{STATUS |\toindex|
|000011f0| 7b 46 74 70 55 73 65 72 | 7d 28 46 54 50 7e 2a 2c |{FtpUser|}(FTP~*,|
|00001200| 20 63 68 61 72 7e 2a 75 | 73 65 72 29 7d 0a 7b 0a | char~*u|ser)}.{.|
|00001210| 20 53 65 6e 64 73 20 74 | 68 65 20 6e 61 6d 65 20 | Sends t|he name |
|00001220| 6f 66 20 74 68 65 20 75 | 73 65 72 20 74 6f 20 74 |of the u|ser to t|
|00001230| 68 65 20 73 65 72 76 65 | 72 2e 20 54 68 65 20 63 |he serve|r. The c|
|00001240| 6f 6e 6e 65 63 74 69 6f | 6e 20 6d 75 73 74 20 62 |onnectio|n must b|
|00001250| 65 20 64 6f 6e 65 20 62 | 65 66 6f 72 65 20 69 74 |e done b|efore it|
|00001260| 2e 0a 7d 0a 0a 5c 74 74 | 74 7b 53 54 41 54 55 53 |..}..\tt|t{STATUS|
|00001270| 20 5c 74 6f 69 6e 64 65 | 78 7b 46 74 70 50 61 73 | \toinde|x{FtpPas|
|00001280| 73 77 6f 72 64 7d 28 46 | 54 50 7e 2a 2c 20 63 68 |sword}(F|TP~*, ch|
|00001290| 61 72 7e 2a 70 61 73 73 | 77 6f 72 64 29 7d 0a 7b |ar~*pass|word)}.{|
|000012a0| 0a 20 53 65 6e 64 73 20 | 5c 74 73 7b 70 61 73 73 |. Sends |\ts{pass|
|000012b0| 77 6f 72 64 7d 20 74 6f | 20 74 68 65 20 73 65 72 |word} to| the ser|
|000012c0| 76 65 72 2e 20 54 68 65 | 20 66 75 6e 63 74 69 6f |ver. The| functio|
|000012d0| 6e 20 5c 74 73 7b 46 74 | 70 55 73 65 72 7d 20 6d |n \ts{Ft|pUser} m|
|000012e0| 75 73 74 20 62 65 20 63 | 61 6c 6c 65 64 20 62 65 |ust be c|alled be|
|000012f0| 66 6f 72 65 20 69 74 2e | 0a 7d 0a 0a 5c 74 74 74 |fore it.|.}..\ttt|
|00001300| 7b 53 54 41 54 55 53 20 | 5c 74 6f 69 6e 64 65 78 |{STATUS |\toindex|
|00001310| 7b 46 74 70 41 63 63 6f | 75 6e 74 7d 28 46 54 50 |{FtpAcco|unt}(FTP|
|00001320| 7e 2a 2c 20 63 68 61 72 | 7e 2a 61 63 63 74 29 7d |~*, char|~*acct)}|
|00001330| 0a 7b 0a 20 53 65 6e 64 | 73 20 61 20 6e 61 6d 65 |.{. Send|s a name|
|00001340| 20 6f 66 20 74 68 65 20 | 61 63 63 6f 75 6e 74 20 | of the |account |
|00001350| 74 6f 20 74 68 65 20 73 | 65 72 76 65 72 2e 20 54 |to the s|erver. T|
|00001360| 68 65 20 6e 61 6d 65 20 | 6f 66 20 74 68 65 20 61 |he name |of the a|
|00001370| 63 63 6f 75 6e 74 20 69 | 73 20 6e 6f 74 20 73 74 |ccount i|s not st|
|00001380| 61 6e 64 61 72 64 0a 20 | 61 74 74 72 69 62 75 74 |andard. |attribut|
|00001390| 65 20 66 6f 72 20 6d 61 | 6e 79 20 73 79 73 74 65 |e for ma|ny syste|
|000013a0| 6d 73 2c 20 73 6f 20 74 | 68 69 73 20 66 75 6e 63 |ms, so t|his func|
|000013b0| 74 69 6f 6e 20 69 73 20 | 75 73 65 64 20 76 65 72 |tion is |used ver|
|000013c0| 79 20 73 65 6c 64 6f 6d | 2e 0a 20 54 68 65 20 66 |y seldom|.. The f|
|000013d0| 75 6e 63 74 69 6f 6e 20 | 5c 74 73 7b 46 74 70 50 |unction |\ts{FtpP|
|000013e0| 61 73 73 77 6f 72 64 7d | 20 6d 75 73 74 20 62 65 |assword}| must be|
|000013f0| 20 63 61 6c 6c 65 64 20 | 62 65 66 6f 72 65 20 69 | called |before i|
|00001400| 74 2e 0a 7d 0a 0a 5c 74 | 74 74 7b 0a 53 54 41 54 |t..}..\t|tt{.STAT|
|00001410| 55 53 20 5c 74 6f 69 6e | 64 65 78 7b 46 74 70 4c |US \toin|dex{FtpL|
|00001420| 6f 67 69 6e 7d 28 46 54 | 50 7e 2a 2a 2c 20 63 68 |ogin}(FT|P~**, ch|
|00001430| 61 72 7e 2a 68 6f 73 74 | 6e 61 6d 65 2c 20 63 68 |ar~*host|name, ch|
|00001440| 61 72 7e 2a 75 73 65 72 | 2c 20 63 68 61 72 7e 2a |ar~*user|, char~*|
|00001450| 70 61 73 73 77 6f 72 64 | 2c 20 63 68 61 72 7e 2a |password|, char~*|
|00001460| 61 63 63 6f 75 6e 74 29 | 7d 0a 7b 0a 20 20 45 78 |account)|}.{. Ex|
|00001470| 65 63 75 74 65 73 20 66 | 75 6e 63 74 69 6f 6e 73 |ecutes f|unctions|
|00001480| 20 5c 74 73 7b 46 74 70 | 43 6f 6e 6e 65 63 74 7d | \ts{Ftp|Connect}|
|00001490| 2c 20 5c 74 73 7b 46 74 | 70 55 73 65 72 7d 2c 20 |, \ts{Ft|pUser}, |
|000014a0| 5c 74 73 7b 46 74 70 50 | 61 73 73 77 6f 72 64 7d |\ts{FtpP|assword}|
|000014b0| 2c 0a 20 20 5c 74 73 7b | 46 74 70 41 63 63 6f 75 |,. \ts{|FtpAccou|
|000014c0| 6e 74 7d 20 28 69 66 20 | 6e 65 63 65 73 73 61 72 |nt} (if |necessar|
|000014d0| 79 29 20 20 63 6f 6e 73 | 69 73 74 65 6e 74 6c 79 |y) cons|istently|
|000014e0| 2e 20 49 66 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |. If the| name of|
|000014f0| 20 74 68 65 20 61 63 63 | 6f 75 6e 74 20 69 73 20 | the acc|ount is |
|00001500| 61 62 73 65 6e 74 2c 20 | 0a 20 20 72 65 70 6c 61 |absent, |. repla|
|00001510| 63 65 73 20 69 74 20 77 | 69 74 68 20 74 68 65 20 |ces it w|ith the |
|00001520| 5c 74 73 7b 4e 55 4c 4c | 7d 20 76 61 6c 75 65 2e |\ts{NULL|} value.|
|00001530| 0a 7d 0a 0a 5c 74 74 74 | 7b 53 54 41 54 55 53 20 |.}..\ttt|{STATUS |
|00001540| 5c 74 6f 69 6e 64 65 78 | 7b 46 74 70 42 79 65 7d |\toindex|{FtpBye}|
|00001550| 28 46 54 50 7e 2a 29 7d | 0a 7b 20 46 69 6e 69 73 |(FTP~*)}|.{ Finis|
|00001560| 68 65 73 20 77 6f 72 6b | 20 77 69 74 68 20 74 68 |hes work| with th|
|00001570| 65 20 73 65 72 76 65 72 | 20 61 6e 64 20 63 6c 6f |e server| and clo|
|00001580| 73 65 73 20 61 6c 6c 20 | 63 68 61 6e 6e 65 6c 73 |ses all |channels|
|00001590| 2e 20 0a 5c 66 6f 6f 74 | 6e 6f 74 65 7b 59 6f 75 |. .\foot|note{You|
|000015a0| 20 63 61 6e 20 73 65 65 | 20 66 72 6f 6d 20 74 68 | can see| from th|
|000015b0| 65 20 64 65 73 63 72 69 | 70 74 69 6f 6e 20 6f 66 |e descri|ption of|
|000015c0| 20 63 6f 6e 6e 65 63 74 | 2f 64 69 73 63 6f 6e 6e | connect|/disconn|
|000015d0| 65 63 74 20 66 75 6e 63 | 74 69 6f 6e 73 2c 20 74 |ect func|tions, t|
|000015e0| 68 61 74 20 79 6f 75 20 | 63 61 6e 20 63 72 65 61 |hat you |can crea|
|000015f0| 74 65 20 0a 6d 6f 72 65 | 20 74 68 61 6e 20 6f 6e |te .more| than on|
|00001600| 65 20 63 6f 6e 6e 65 63 | 74 69 6f 6e 20 74 6f 20 |e connec|tion to |
|00001610| 73 65 72 76 65 72 73 20 | 73 69 6d 75 6c 74 61 6e |servers |simultan|
|00001620| 65 6f 75 73 6c 79 2e 0a | 0a 7d 0a 0a 5c 73 65 63 |eously..|.}..\sec|
|00001630| 74 69 6f 6e 7b 54 68 65 | 20 64 65 62 75 67 67 69 |tion{The| debuggi|
|00001640| 6e 67 7d 20 5c 6c 61 62 | 65 6c 7b 64 65 62 75 67 |ng} \lab|el{debug|
|00001650| 7d 20 0a 0a 54 68 65 72 | 65 20 69 73 20 61 20 70 |} ..Ther|e is a p|
|00001660| 6f 73 73 69 62 69 6c 69 | 74 79 20 74 6f 20 70 72 |ossibili|ty to pr|
|00001670| 65 64 65 66 69 6e 65 20 | 74 68 72 65 65 20 66 75 |edefine |three fu|
|00001680| 6e 63 74 69 6f 6e 73 2c | 20 73 75 63 68 20 61 73 |nctions,| such as|
|00001690| 3a 0a 5c 66 6f 6f 74 6e | 6f 74 65 7b 49 66 20 74 |:.\footn|ote{If t|
|000016a0| 68 65 20 5c 74 73 7b 4e | 55 4c 4c 7d 20 76 61 6c |he \ts{N|ULL} val|
|000016b0| 75 65 20 69 73 20 74 72 | 61 6e 73 66 65 72 72 65 |ue is tr|ansferre|
|000016c0| 64 20 61 73 20 61 20 70 | 61 72 61 6d 65 74 65 72 |d as a p|arameter|
|000016d0| 20 5c 74 73 7b 60 60 66 | 75 6e 63 74 69 6f 6e 27 | \ts{``f|unction'|
|000016e0| 27 7d 20 74 6f 20 74 68 | 65 20 66 75 6e 63 74 69 |'} to th|e functi|
|000016f0| 6f 6e 73 2c 20 64 65 73 | 63 72 69 62 65 64 20 62 |ons, des|cribed b|
|00001700| 65 6c 6f 77 2c 0a 74 68 | 65 20 64 65 62 75 67 67 |elow,.th|e debugg|
|00001710| 69 6e 67 20 77 69 6c 6c | 20 62 65 20 74 75 72 6e |ing will| be turn|
|00001720| 65 64 20 6f 66 66 2e 7d | 0a 0a 5c 74 74 74 7b 5c |ed off.}|..\ttt{\|
|00001730| 74 6f 69 6e 64 65 78 7b | 46 74 70 53 65 74 44 65 |toindex{|FtpSetDe|
|00001740| 62 75 67 48 61 6e 64 6c | 65 72 7d 28 46 54 50 20 |bugHandl|er}(FTP |
|00001750| 2a 2c 66 75 6e 63 74 69 | 6f 6e 29 7d 0a 7b 20 20 |*,functi|on)}.{ |
|00001760| 50 72 65 64 65 66 69 6e | 65 73 20 66 75 6e 63 74 |Predefin|es funct|
|00001770| 69 6f 6e 20 6f 66 20 70 | 72 6f 74 6f 63 6f 6c 20 |ion of p|rotocol |
|00001780| 64 65 62 75 67 67 69 6e | 67 2e 0a 20 20 20 41 66 |debuggin|g.. Af|
|00001790| 74 65 72 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |ter the |function|
|000017a0| 20 69 73 20 70 72 65 64 | 65 66 69 6e 65 64 2c 20 | is pred|efined, |
|000017b0| 69 74 20 69 73 20 63 61 | 6c 6c 65 64 20 77 69 74 |it is ca|lled wit|
|000017c0| 68 20 65 76 65 72 79 20 | 0a 20 20 20 73 65 6e 64 |h every |. send|
|000017d0| 69 6e 67 2f 72 65 63 65 | 69 76 69 6e 67 20 6d 65 |ing/rece|iving me|
|000017e0| 73 73 61 67 65 73 20 66 | 72 6f 6d 20 74 68 65 20 |ssages f|rom the |
|000017f0| 73 65 72 76 65 72 2e 0a | 20 20 20 54 68 65 20 66 |server..| The f|
|00001800| 75 6e 63 74 69 6f 6e 2c | 20 64 65 66 69 6e 65 64 |unction,| defined|
|00001810| 20 61 73 20 61 20 64 65 | 62 75 67 20 68 61 6e 64 | as a de|bug hand|
|00001820| 6c 65 72 20 6d 75 73 74 | 20 64 6f 20 72 65 74 75 |ler must| do retu|
|00001830| 72 6e 73 20 74 6f 20 74 | 68 65 20 63 61 6c 6c 69 |rns to t|he calli|
|00001840| 6e 67 20 0a 66 75 6e 63 | 74 69 6f 6e 73 20 28 5c |ng .func|tions (\|
|00001850| 74 73 7b 46 74 70 53 65 | 6e 64 4d 65 73 73 61 67 |ts{FtpSe|ndMessag|
|00001860| 65 7d 2f 5c 74 73 7b 46 | 74 70 47 65 74 4d 65 73 |e}/\ts{F|tpGetMes|
|00001870| 73 61 67 65 7d 29 2c 20 | 62 75 74 20 63 61 6e 20 |sage}), |but can |
|00001880| 61 6c 73 6f 20 61 62 6f | 72 74 20 74 68 65 20 70 |also abo|rt the p|
|00001890| 72 6f 67 72 61 6d 2e 20 | 0a 0a 7d 0a 0a 5c 74 74 |rogram. |..}..\tt|
|000018a0| 74 7b 5c 74 6f 69 6e 64 | 65 78 7b 46 74 70 53 65 |t{\toind|ex{FtpSe|
|000018b0| 74 45 72 72 6f 72 48 61 | 6e 64 6c 65 72 7d 28 46 |tErrorHa|ndler}(F|
|000018c0| 54 50 20 2a 2c 66 75 6e | 63 74 69 6f 6e 29 7d 0a |TP *,fun|ction)}.|
|000018d0| 7b 0a 20 20 20 50 72 65 | 64 65 66 69 6e 65 73 20 |{. Pre|defines |
|000018e0| 65 72 72 6f 72 20 68 61 | 6e 64 6c 65 72 2e 20 49 |error ha|ndler. I|
|000018f0| 66 20 74 68 65 20 73 65 | 72 76 65 72 27 73 20 61 |f the se|rver's a|
|00001900| 6e 73 77 65 72 20 6d 65 | 61 6e 73 2c 20 74 68 61 |nswer me|ans, tha|
|00001910| 74 20 74 68 65 20 6f 70 | 65 72 61 74 69 6f 6e 20 |t the op|eration |
|00001920| 69 73 20 6e 6f 74 20 66 | 69 6e 69 73 68 65 64 20 |is not f|inished |
|00001930| 0a 20 63 6f 72 72 65 63 | 74 6c 79 2c 20 74 68 69 |. correc|tly, thi|
|00001940| 73 20 66 75 6e 63 74 69 | 6f 6e 20 77 69 6c 6c 20 |s functi|on will |
|00001950| 62 65 20 63 61 6c 6c 65 | 64 2e 0a 20 20 20 54 68 |be calle|d.. Th|
|00001960| 65 20 72 65 73 75 6c 74 | 20 63 6f 64 65 20 69 73 |e result| code is|
|00001970| 20 6e 65 67 61 74 69 76 | 65 2c 20 69 66 20 61 6e | negativ|e, if an|
|00001980| 20 65 72 72 6f 72 20 69 | 73 20 6f 63 63 75 72 73 | error i|s occurs|
|00001990| 2e 0a 7d 0a 5c 74 74 74 | 7b 5c 74 6f 69 6e 64 65 |..}.\ttt|{\toinde|
|000019a0| 78 7b 46 74 70 53 65 74 | 49 4f 48 61 6e 64 6c 65 |x{FtpSet|IOHandle|
|000019b0| 72 7d 28 46 54 50 20 2a | 2c 66 75 6e 63 74 69 6f |r}(FTP *|,functio|
|000019c0| 6e 29 7d 0a 7b 0a 20 20 | 20 50 72 65 64 65 66 69 |n)}.{. | Predefi|
|000019d0| 6e 65 73 20 68 61 6e 64 | 6c 65 72 20 6f 66 20 49 |nes hand|ler of I|
|000019e0| 6e 70 75 74 2f 4f 75 74 | 70 75 74 20 70 72 6f 63 |nput/Out|put proc|
|000019f0| 65 73 73 69 6e 67 2e 20 | 54 68 69 73 20 66 75 6e |essing. |This fun|
|00001a00| 63 74 69 6f 6e 20 69 73 | 20 63 61 6c 6c 65 64 2c |ction is| called,|
|00001a10| 20 77 68 65 6e 20 61 20 | 63 6f 6e 6e 65 63 74 69 | when a |connecti|
|00001a20| 6f 6e 20 74 6f 20 74 68 | 65 20 20 0a 20 20 20 73 |on to th|e . s|
|00001a30| 65 72 76 65 72 20 69 73 | 20 62 72 6f 6b 65 6e 2e |erver is| broken.|
|00001a40| 20 46 6f 72 20 65 78 61 | 6d 70 6c 65 2c 20 77 68 | For exa|mple, wh|
|00001a50| 65 6e 20 74 68 65 20 6e | 65 74 77 6f 72 6b 20 6f |en the n|etwork o|
|00001a60| 72 20 74 68 65 20 72 65 | 6d 6f 74 65 20 68 6f 73 |r the re|mote hos|
|00001a70| 74 20 69 73 20 64 6f 77 | 6e 2e 20 54 68 69 73 20 |t is dow|n. This |
|00001a80| 68 61 6e 64 6c 65 72 20 | 61 6c 73 6f 20 69 73 0a |handler |also is.|
|00001a90| 20 20 20 63 61 6c 6c 65 | 64 20 61 66 74 65 72 20 | calle|d after |
|00001aa0| 74 68 65 20 20 5c 74 6f | 69 6e 64 65 78 7b 74 69 |the \to|index{ti|
|00001ab0| 6d 65 6f 75 74 7d 20 6f | 66 20 6f 6e 65 20 63 68 |meout} o|f one ch|
|00001ac0| 61 72 61 63 74 65 72 20 | 77 61 69 74 69 6e 67 20 |aracter |waiting |
|00001ad0| 65 78 70 69 72 65 73 2e | 20 20 20 0a 7d 0a 0a 5c |expires.| .}..\|
|00001ae0| 74 74 74 7b 5c 74 6f 69 | 6e 64 65 78 7b 46 74 70 |ttt{\toi|ndex{Ftp|
|00001af0| 44 65 62 75 67 7d 28 46 | 54 50 20 2a 29 7d 0a 7b |Debug}(F|TP *)}.{|
|00001b00| 0a 54 75 72 6e 73 20 6f | 6e 20 61 6c 6c 20 73 74 |.Turns o|n all st|
|00001b10| 61 6e 64 61 72 64 20 64 | 65 62 75 67 67 69 6e 67 |andard d|ebugging|
|00001b20| 20 66 75 6e 63 74 69 6f | 6e 73 2e 20 0a 5c 74 63 | functio|ns. .\tc|
|00001b30| 7b 5c 74 6f 69 6e 64 65 | 78 7b 46 74 70 44 65 62 |{\toinde|x{FtpDeb|
|00001b40| 75 67 45 72 72 6f 72 7d | 7d 7b 2d 2d 2d 20 70 72 |ugError}|}{--- pr|
|00001b50| 69 6e 74 73 20 61 20 73 | 74 72 69 6e 67 2c 20 74 |ints a s|tring, t|
|00001b60| 61 6b 65 6e 20 66 72 6f | 6d 20 74 68 65 20 73 65 |aken fro|m the se|
|00001b70| 72 76 65 72 2c 20 61 6e | 64 20 61 62 6f 72 74 73 |rver, an|d aborts|
|00001b80| 20 74 68 65 20 70 72 6f | 67 72 61 6d 3b 7d 0a 5c | the pro|gram;}.\|
|00001b90| 74 63 7b 5c 74 6f 69 6e | 64 65 78 7b 46 74 70 44 |tc{\toin|dex{FtpD|
|00001ba0| 65 62 75 67 44 65 62 75 | 67 7d 7d 7b 2d 2d 2d 20 |ebugDebu|g}}{--- |
|00001bb0| 70 72 69 6e 74 73 20 61 | 20 73 74 72 69 6e 67 2c |prints a| string,|
|00001bc0| 20 74 61 6b 65 6e 20 66 | 72 6f 6d 20 74 68 65 20 | taken f|rom the |
|00001bd0| 73 65 72 76 65 72 3b 7d | 0a 5c 74 63 7b 5c 74 6f |server;}|.\tc{\to|
|00001be0| 69 6e 64 65 78 7b 46 74 | 70 44 65 62 75 67 49 4f |index{Ft|pDebugIO|
|00001bf0| 7d 7d 7b 2d 2d 2d 20 70 | 72 69 6e 74 73 20 73 74 |}}{--- p|rints st|
|00001c00| 72 69 6e 67 20 5c 74 73 | 7b 73 74 72 65 72 72 6f |ring \ts|{strerro|
|00001c10| 72 28 65 72 72 6e 6f 29 | 7d 20 61 6e 64 20 61 62 |r(errno)|} and ab|
|00001c20| 6f 72 74 73 20 74 68 65 | 20 70 72 6f 67 72 61 6d |orts the| program|
|00001c30| 2e 7d 0a 7d 0a 0a 41 6c | 6c 20 66 75 6e 63 74 69 |.}.}..Al|l functi|
|00001c40| 6f 6e 20 66 6f 72 20 64 | 65 62 75 67 67 69 6e 67 |on for d|ebugging|
|00001c50| 20 68 61 76 65 20 74 68 | 72 65 65 20 61 72 67 75 | have th|ree argu|
|00001c60| 6d 65 6e 74 73 3a 5c 5c | 0a 31 2e 20 50 6f 69 6e |ments:\\|.1. Poin|
|00001c70| 74 65 72 20 74 6f 20 46 | 54 50 20 64 61 74 61 20 |ter to F|TP data |
|00001c80| 73 74 72 75 63 74 75 72 | 65 3b 5c 5c 0a 32 2e 20 |structur|e;\\.2. |
|00001c90| 4c 61 73 74 20 72 65 74 | 75 72 6e 65 64 20 76 61 |Last ret|urned va|
|00001ca0| 6c 75 65 20 66 72 6f 6d | 20 74 68 65 20 73 65 72 |lue from| the ser|
|00001cb0| 76 65 72 2e 20 57 68 65 | 6e 20 65 72 72 6f 72 73 |ver. Whe|n errors|
|00001cc0| 20 6f 63 63 75 72 2c 20 | 74 68 65 20 76 61 6c 75 | occur, |the valu|
|00001cd0| 65 20 69 73 20 6c 65 73 | 73 20 74 68 61 6e 20 31 |e is les|s than 1|
|00001ce0| 3b 5c 5c 0a 33 2e 20 44 | 69 61 67 6e 6f 73 74 69 |;\\.3. D|iagnosti|
|00001cf0| 63 20 73 74 72 69 6e 67 | 2e 0a 0a 5c 74 74 74 7b |c string|...\ttt{|
|00001d00| 5c 74 6f 69 6e 64 65 78 | 7b 46 74 70 6c 69 62 44 |\toindex|{FtplibD|
|00001d10| 65 62 75 67 7d 28 31 20 | 6f 72 20 30 29 7d 0a 7b |ebug}(1 |or 0)}.{|
|00001d20| 09 54 75 72 6e 73 20 6f | 6e 2f 6f 66 66 20 61 75 |.Turns o|n/off au|
|00001d30| 74 6f 73 74 61 72 74 20 | 64 65 62 75 67 20 6d 6f |tostart |debug mo|
|00001d40| 64 65 2c 20 77 68 65 6e | 20 63 6f 6e 6e 65 63 74 |de, when| connect|
|00001d50| 69 6f 6e 20 69 73 20 65 | 73 74 61 62 6c 69 73 68 |ion is e|stablish|
|00001d60| 65 64 2e 0a 7d 0a 0a 5c | 73 65 63 74 69 6f 6e 7b |ed..}..\|section{|
|00001d70| 44 61 74 61 20 74 72 61 | 6e 73 66 65 72 20 70 72 |Data tra|nsfer pr|
|00001d80| 6f 63 65 64 75 72 65 73 | 20 66 72 6f 6d 20 74 68 |ocedures| from th|
|00001d90| 65 20 73 65 72 76 65 72 | 7d 0a 0a 5c 74 74 74 7b |e server|}..\ttt{|
|00001da0| 53 54 41 54 55 53 20 20 | 5c 74 6f 69 6e 64 65 78 |STATUS |\toindex|
|00001db0| 7b 46 74 70 52 65 74 72 | 54 69 6d 65 6f 75 74 7d |{FtpRetr|Timeout}|
|00001dc0| 28 46 54 50 7e 2a 2c 20 | 63 68 61 72 7e 2a 63 6f |(FTP~*, |char~*co|
|00001dd0| 6d 6d 61 6e 64 2c 20 63 | 68 61 72 7e 2a 69 6e 70 |mmand, c|har~*inp|
|00001de0| 2c 20 63 68 61 72 7e 2a | 6f 75 74 0a 5c 66 6f 6f |, char~*|out.\foo|
|00001df0| 74 6e 6f 74 65 7b 57 68 | 65 6e 20 74 68 65 20 6e |tnote{Wh|en the n|
|00001e00| 61 6d 65 20 6f 66 20 74 | 68 65 20 6c 6f 63 61 6c |ame of t|he local|
|00001e10| 20 66 69 6c 65 20 69 73 | 20 5c 74 73 7b 2a 53 54 | file is| \ts{*ST|
|00001e20| 44 49 4e 2a 7d 2c 20 5c | 74 73 7b 2a 53 54 44 4f |DIN*}, \|ts{*STDO|
|00001e30| 55 54 2a 7d 2c 20 5c 74 | 73 7b 2a 53 54 44 45 52 |UT*}, \t|s{*STDER|
|00001e40| 52 2a 7d 2c 20 74 68 65 | 6e 20 74 68 65 20 63 75 |R*}, the|n the cu|
|00001e50| 72 72 65 6e 74 20 73 74 | 72 65 61 6d 20 69 73 0a |rrent st|ream is.|
|00001e60| 72 65 64 69 72 65 63 74 | 65 64 20 74 6f 20 74 68 |redirect|ed to th|
|00001e70| 65 73 65 20 63 68 61 6e | 6e 65 6c 73 7d 2c 20 6c |ese chan|nels}, l|
|00001e80| 6f 6e 67 7e 74 69 6d 65 | 29 7d 0a 7b 0a 09 53 65 |ong~time|)}.{..Se|
|00001e90| 6e 64 73 20 61 20 63 6f | 6d 6d 61 6e 64 20 74 6f |nds a co|mmand to|
|00001ea0| 20 74 68 65 20 73 65 72 | 76 65 72 2c 20 69 66 20 | the ser|ver, if |
|00001eb0| 63 6f 6d 6d 61 6e 64 20 | 63 6f 6e 74 61 69 6e 73 |command |contains|
|00001ec0| 20 73 75 62 73 74 72 69 | 6e 67 20 5c 70 73 2c 20 | substri|ng \ps, |
|00001ed0| 69 74 20 77 69 6c 6c 20 | 62 65 20 72 65 70 6c 61 |it will |be repla|
|00001ee0| 63 65 64 20 62 79 20 0a | 20 20 20 20 20 20 20 20 |ced by .| |
|00001ef0| 73 74 72 69 6e 67 20 5c | 74 73 7b 69 6e 70 7d 2e |string \|ts{inp}.|
|00001f00| 0a 09 43 72 65 61 74 65 | 73 20 64 61 74 61 20 74 |..Create|s data t|
|00001f10| 72 61 6e 73 66 65 72 20 | 63 68 61 6e 6e 65 6c 2c |ransfer |channel,|
|00001f20| 20 61 6e 64 20 63 6f 70 | 79 69 6e 67 20 64 61 74 | and cop|ying dat|
|00001f30| 61 20 66 72 6f 6d 20 74 | 68 69 73 20 63 68 61 6e |a from t|his chan|
|00001f40| 6e 65 6c 20 74 6f 20 61 | 20 6c 6f 63 61 6c 20 66 |nel to a| local f|
|00001f50| 69 6c 65 20 5c 74 73 7b | 6f 75 74 7d 2e 0a 09 49 |ile \ts{|out}...I|
|00001f60| 66 20 64 75 72 69 6e 67 | 20 74 69 6d 65 20 70 65 |f during| time pe|
|00001f70| 72 69 6f 64 20 5c 74 73 | 7b 60 60 74 69 6d 65 27 |riod \ts|{``time'|
|00001f80| 27 7d 20 6e 6f 20 63 68 | 61 72 61 63 74 65 72 73 |'} no ch|aracters|
|00001f90| 20 61 72 65 20 6f 62 74 | 61 69 6e 65 64 20 66 72 | are obt|ained fr|
|00001fa0| 6f 6d 20 74 68 65 20 73 | 65 72 76 65 72 2c 20 74 |om the s|erver, t|
|00001fb0| 68 69 73 20 0a 09 63 6f | 6e 6e 65 63 74 69 6f 6e |his ..co|nnection|
|00001fc0| 20 77 69 6c 6c 20 62 65 | 20 63 6c 6f 73 65 64 2c | will be| closed,|
|00001fd0| 20 61 6e 64 20 49 6e 70 | 75 74 2f 4f 75 74 70 75 | and Inp|ut/Outpu|
|00001fe0| 74 20 65 72 72 6f 72 20 | 73 74 61 74 75 73 20 77 |t error |status w|
|00001ff0| 69 6c 6c 20 62 65 20 72 | 65 74 75 72 6e 65 64 2e |ill be r|eturned.|
|00002000| 0a 09 57 68 65 6e 20 5c | 74 6f 69 6e 64 65 78 7b |..When \|toindex{|
|00002010| 74 69 6d 65 6f 75 74 7d | 3d 30 2c 20 74 69 6d 65 |timeout}|=0, time|
|00002020| 6f 75 74 20 69 6e 20 6c | 69 62 72 61 72 79 20 6c |out in l|ibrary l|
|00002030| 65 76 65 6c 20 77 69 6c | 6c 20 62 65 20 74 75 72 |evel wil|l be tur|
|00002040| 6e 65 64 20 6f 66 66 2c | 20 62 75 74 0a 09 70 72 |ned off,| but..pr|
|00002050| 6f 63 65 64 75 72 65 73 | 20 6d 61 79 20 62 65 20 |ocedures| may be |
|00002060| 61 62 6f 72 74 65 64 20 | 62 79 20 74 68 65 20 6b |aborted |by the k|
|00002070| 65 72 6e 65 6c 20 6f 66 | 20 54 43 50 2f 49 50 2c |ernel of| TCP/IP,|
|00002080| 20 77 68 65 6e 20 74 68 | 65 20 6b 65 72 6e 65 6c | when th|e kernel|
|00002090| 27 73 20 5c 74 73 7b 74 | 69 6d 65 6f 75 74 7d 20 |'s \ts{t|imeout} |
|000020a0| 65 78 70 69 72 65 73 2e | 20 20 0a 20 20 20 20 20 |expires.| . |
|000020b0| 20 20 20 5c 66 6f 6f 74 | 6e 6f 74 65 7b 49 6e 20 | \foot|note{In |
|000020c0| 64 69 66 66 65 72 65 6e | 74 20 6b 65 72 6e 65 6c |differen|t kernel|
|000020d0| 73 20 74 69 6d 65 6f 75 | 74 20 69 73 20 64 69 66 |s timeou|t is dif|
|000020e0| 66 65 72 65 6e 74 7d 0a | 7d 0a 0a 5c 74 74 74 7b |ferent}.|}..\ttt{|
|000020f0| 5c 74 6f 69 6e 64 65 78 | 7b 46 74 70 52 65 74 72 |\toindex|{FtpRetr|
|00002100| 7d 28 46 54 50 7e 2a 2c | 20 63 68 61 72 7e 2a 63 |}(FTP~*,| char~*c|
|00002110| 6f 6d 6d 61 6e 64 2c 20 | 63 68 61 72 7e 2a 69 6e |ommand, |char~*in|
|00002120| 70 2c 20 63 68 61 72 7e | 2a 6f 75 74 29 7d 0a 7b |p, char~|*out)}.{|
|00002130| 0a 20 43 61 6c 6c 73 20 | 5c 74 73 7b 46 74 70 52 |. Calls |\ts{FtpR|
|00002140| 65 74 72 54 69 6d 65 6f | 75 74 7d 2c 20 77 69 74 |etrTimeo|ut}, wit|
|00002150| 68 20 74 75 72 6e 65 64 | 20 6f 66 66 20 5c 74 73 |h turned| off \ts|
|00002160| 7b 74 69 6d 65 6f 75 74 | 7d 2e 0a 7d 0a 0a 5c 74 |{timeout|}..}..\t|
|00002170| 74 74 7b 5c 74 6f 69 6e | 64 65 78 7b 46 74 70 47 |tt{\toin|dex{FtpG|
|00002180| 65 74 54 69 6d 65 6f 75 | 74 7d 28 46 54 50 7e 2a |etTimeou|t}(FTP~*|
|00002190| 2c 20 63 68 61 72 7e 2a | 69 6e 70 2c 20 63 68 61 |, char~*|inp, cha|
|000021a0| 72 7e 2a 6f 75 74 2c 20 | 6c 6f 6e 67 7e 74 69 6d |r~*out, |long~tim|
|000021b0| 65 29 7d 0a 7b 0a 20 54 | 72 61 6e 73 66 65 72 73 |e)}.{. T|ransfers|
|000021c0| 20 66 69 6c 65 20 5c 74 | 73 7b 69 6e 70 7d 20 66 | file \t|s{inp} f|
|000021d0| 72 6f 6d 20 74 68 65 20 | 73 65 72 76 65 72 20 74 |rom the |server t|
|000021e0| 6f 20 74 68 65 20 6c 6f | 63 61 6c 20 66 69 6c 65 |o the lo|cal file|
|000021f0| 20 5c 74 73 7b 6f 75 74 | 7d 2c 20 77 69 74 68 20 | \ts{out|}, with |
|00002200| 5c 74 73 7b 74 69 6d 65 | 6f 75 74 3d 74 69 6d 65 |\ts{time|out=time|
|00002210| 7d 2e 7d 0a 0a 5c 74 74 | 74 7b 5c 74 6f 69 6e 64 |}.}..\tt|t{\toind|
|00002220| 65 78 7b 46 74 70 47 65 | 74 7d 28 46 54 50 7e 2a |ex{FtpGe|t}(FTP~*|
|00002230| 2c 20 63 68 61 72 7e 2a | 69 6e 2c 20 63 68 61 72 |, char~*|in, char|
|00002240| 7e 2a 6f 75 74 29 7d 0a | 7b 0a 20 43 61 6c 6c 73 |~*out)}.|{. Calls|
|00002250| 20 5c 74 73 7b 46 74 70 | 47 65 74 54 69 6d 65 6f | \ts{Ftp|GetTimeo|
|00002260| 75 74 7d 2c 20 77 69 74 | 68 20 74 75 72 6e 65 64 |ut}, wit|h turned|
|00002270| 20 6f 66 66 20 5c 74 73 | 7b 74 69 6d 65 6f 75 74 | off \ts|{timeout|
|00002280| 7d 2e 0a 0a 7d 0a 5c 74 | 74 74 7b 5c 74 6f 69 6e |}...}.\t|tt{\toin|
|00002290| 64 65 78 7b 46 74 70 44 | 69 72 65 63 74 6f 72 79 |dex{FtpD|irectory|
|000022a0| 7d 28 46 54 50 7e 2a 2c | 20 63 68 61 72 7e 2a 70 |}(FTP~*,| char~*p|
|000022b0| 61 74 5c 66 6f 6f 74 6e | 6f 74 65 7b 54 68 69 73 |at\footn|ote{This|
|000022c0| 20 69 73 20 74 68 65 20 | 66 69 72 73 74 20 61 72 | is the |first ar|
|000022d0| 67 75 6d 65 6e 74 20 66 | 6f 72 20 5c 74 73 7b 60 |gument f|or \ts{`|
|000022e0| 60 6c 73 27 27 7d 20 63 | 6f 6d 6d 61 6e 64 7d 2c |`ls''} c|ommand},|
|000022f0| 20 63 68 61 72 7e 2a 6f | 75 74 29 7d 0a 7b 0a 20 | char~*o|ut)}.{. |
|00002300| 54 72 61 6e 73 66 65 72 | 73 20 66 69 6c 65 73 20 |Transfer|s files |
|00002310| 6c 69 73 74 69 6e 67 20 | 66 72 6f 6d 20 74 68 65 |listing |from the|
|00002320| 20 73 65 72 76 65 72 2c | 20 64 65 73 63 72 69 62 | server,| describ|
|00002330| 65 64 20 62 79 20 5c 74 | 73 7b 70 61 74 7d 2c 20 |ed by \t|s{pat}, |
|00002340| 74 6f 20 74 68 65 20 6c | 6f 63 61 6c 20 66 69 6c |to the l|ocal fil|
|00002350| 65 20 5c 74 73 7b 6f 75 | 74 7d 2e 0a 7d 0a 5c 74 |e \ts{ou|t}..}.\t|
|00002360| 74 74 7b 5c 74 6f 69 6e | 64 65 78 7b 46 74 70 44 |tt{\toin|dex{FtpD|
|00002370| 69 72 7d 28 46 54 50 7e | 2a 2c 20 63 68 61 72 7e |ir}(FTP~|*, char~|
|00002380| 2a 6f 75 74 29 7d 0a 7b | 0a 20 54 72 61 6e 73 66 |*out)}.{|. Transf|
|00002390| 65 72 73 20 66 69 6c 65 | 73 20 6c 69 73 74 69 6e |ers file|s listin|
|000023a0| 67 20 6f 66 20 74 68 65 | 20 63 75 72 72 65 6e 74 |g of the| current|
|000023b0| 20 64 69 72 65 63 74 6f | 72 79 20 66 72 6f 6d 20 | directo|ry from |
|000023c0| 74 68 65 20 73 65 72 76 | 65 72 20 74 6f 20 74 68 |the serv|er to th|
|000023d0| 65 20 6c 6f 63 61 6c 20 | 66 69 6c 65 20 5c 74 73 |e local |file \ts|
|000023e0| 7b 6f 75 74 7d 2e 0a 7d | 0a 0a 5c 73 65 63 74 69 |{out}..}|..\secti|
|000023f0| 6f 6e 7b 44 61 74 61 20 | 74 72 61 6e 73 66 65 72 |on{Data |transfer|
|00002400| 20 70 72 6f 63 65 64 75 | 72 65 73 20 74 6f 20 74 | procedu|res to t|
|00002410| 68 65 20 73 65 72 76 65 | 72 7d 0a 0a 5c 74 74 74 |he serve|r}..\ttt|
|00002420| 7b 5c 74 6f 69 6e 64 65 | 78 7b 46 74 70 53 74 6f |{\toinde|x{FtpSto|
|00002430| 72 54 69 6d 65 6f 75 74 | 7d 28 46 54 50 7e 2a 2c |rTimeout|}(FTP~*,|
|00002440| 20 63 68 61 72 7e 2a 63 | 6f 6d 6d 61 6e 64 2c 20 | char~*c|ommand, |
|00002450| 63 68 61 72 7e 2a 69 6e | 70 2c 20 63 68 61 72 7e |char~*in|p, char~|
|00002460| 2a 6f 75 74 2c 20 6c 6f | 6e 67 7e 74 69 6d 65 29 |*out, lo|ng~time)|
|00002470| 7d 0a 7b 0a 20 20 53 65 | 6e 64 73 20 62 6f 64 79 |}.{. Se|nds body|
|00002480| 20 6f 66 20 74 68 65 20 | 6c 6f 63 61 6c 20 66 69 | of the |local fi|
|00002490| 6c 65 20 5c 74 73 7b 69 | 6e 70 7d 20 74 6f 20 74 |le \ts{i|np} to t|
|000024a0| 68 65 20 73 65 72 76 65 | 72 2c 20 61 6e 64 20 73 |he serve|r, and s|
|000024b0| 74 6f 72 65 73 20 69 74 | 20 69 6e 20 74 68 65 20 |tores it| in the |
|000024c0| 66 69 6c 65 20 5c 74 73 | 7b 6f 75 74 7d 2e 0a 20 |file \ts|{out}.. |
|000024d0| 20 54 68 65 20 60 60 74 | 69 6d 65 27 27 2c 20 69 | The ``t|ime'', i|
|000024e0| 73 20 6d 61 78 69 6d 75 | 6d 20 74 69 6d 65 20 6e |s maximu|m time n|
|000024f0| 65 65 64 65 64 20 74 6f | 20 74 72 61 6e 73 66 65 |eeded to| transfe|
|00002500| 72 20 6f 6e 65 20 63 68 | 61 72 61 63 74 65 72 20 |r one ch|aracter |
|00002510| 74 6f 20 74 68 65 20 73 | 65 72 76 65 72 2e 0a 7d |to the s|erver..}|
|00002520| 0a 0a 5c 74 74 74 7b 5c | 74 6f 69 6e 64 65 78 7b |..\ttt{\|toindex{|
|00002530| 46 74 70 53 74 6f 72 7d | 28 46 54 50 7e 2a 2c 20 |FtpStor}|(FTP~*, |
|00002540| 63 68 61 72 7e 2a 63 6f | 6d 6d 61 6e 64 2c 20 63 |char~*co|mmand, c|
|00002550| 68 61 72 7e 2a 69 6e 70 | 2c 20 63 68 61 72 2a 7e |har~*inp|, char*~|
|00002560| 6f 75 74 29 7d 0a 7b 0a | 20 20 43 61 6c 6c 73 20 |out)}.{.| Calls |
|00002570| 5c 74 73 7b 46 74 70 53 | 74 6f 72 54 69 6d 65 6f |\ts{FtpS|torTimeo|
|00002580| 75 74 7d 2c 20 77 69 74 | 68 6f 75 74 20 5c 74 73 |ut}, wit|hout \ts|
|00002590| 7b 74 69 6d 65 6f 75 74 | 7d 2e 0a 7d 0a 0a 5c 74 |{timeout|}..}..\t|
|000025a0| 74 74 7b 5c 74 6f 69 6e | 64 65 78 7b 46 74 70 50 |tt{\toin|dex{FtpP|
|000025b0| 75 74 54 69 6d 65 6f 75 | 74 7d 28 46 54 50 7e 2a |utTimeou|t}(FTP~*|
|000025c0| 2c 20 63 68 61 72 7e 2a | 69 6e 2c 20 63 68 61 72 |, char~*|in, char|
|000025d0| 7e 2a 6f 75 74 2c 20 6c | 6f 6e 67 7e 74 69 6d 65 |~*out, l|ong~time|
|000025e0| 29 7d 0a 7b 20 54 72 61 | 6e 73 66 65 72 73 20 64 |)}.{ Tra|nsfers d|
|000025f0| 61 74 61 20 66 72 6f 6d | 20 74 68 65 20 6c 6f 63 |ata from| the loc|
|00002600| 61 6c 20 66 69 6c 65 20 | 5c 74 73 7b 69 6e 70 7d |al file |\ts{inp}|
|00002610| 20 74 6f 20 74 68 65 20 | 73 65 72 76 65 72 20 61 | to the |server a|
|00002620| 6e 64 20 73 74 6f 72 65 | 73 20 69 74 20 69 6e 20 |nd store|s it in |
|00002630| 74 68 65 20 66 69 6c 65 | 20 5c 74 73 7b 6f 75 74 |the file| \ts{out|
|00002640| 7d 2e 0a 7d 0a 0a 0a 5c | 74 74 74 7b 5c 74 6f 69 |}..}...\|ttt{\toi|
|00002650| 6e 64 65 78 7b 46 74 70 | 50 75 74 7d 28 46 54 50 |ndex{Ftp|Put}(FTP|
|00002660| 7e 2a 2c 20 63 68 61 72 | 7e 2a 69 6e 2c 20 63 68 |~*, char|~*in, ch|
|00002670| 61 72 7e 2a 6f 75 74 29 | 7d 0a 7b 0a 20 43 61 6c |ar~*out)|}.{. Cal|
|00002680| 6c 73 20 46 74 70 50 75 | 74 54 69 6d 65 6f 75 74 |ls FtpPu|tTimeout|
|00002690| 20 77 69 74 68 20 74 75 | 72 6e 65 64 20 6f 66 66 | with tu|rned off|
|000026a0| 20 74 69 6d 65 6f 75 74 | 2e 0a 7d 0a 0a 0a 5c 73 | timeout|..}...\s|
|000026b0| 65 63 74 69 6f 6e 7b 53 | 65 72 76 65 72 27 73 20 |ection{S|erver's |
|000026c0| 66 69 6c 65 73 20 72 65 | 61 64 2f 77 72 69 74 65 |files re|ad/write|
|000026d0| 20 70 72 6f 63 65 64 75 | 72 65 73 7d 0a 0a 54 68 | procedu|res}..Th|
|000026e0| 69 73 20 6c 69 62 72 61 | 72 79 20 63 6f 6e 74 61 |is libra|ry conta|
|000026f0| 69 6e 73 20 73 70 65 63 | 69 61 6c 20 66 75 6e 63 |ins spec|ial func|
|00002700| 74 69 6f 6e 73 20 66 6f | 72 20 72 65 6d 6f 74 65 |tions fo|r remote|
|00002710| 20 66 69 6c 65 73 20 72 | 65 61 64 69 6e 67 20 61 | files r|eading a|
|00002720| 6e 64 20 77 72 69 74 69 | 6e 67 2c 20 77 69 74 68 |nd writi|ng, with|
|00002730| 6f 75 74 20 70 72 65 63 | 6f 70 79 69 6e 67 0a 74 |out prec|opying.t|
|00002740| 68 65 6d 20 74 6f 20 6c | 6f 63 61 6c 20 66 69 6c |hem to l|ocal fil|
|00002750| 65 73 2e 20 54 68 65 20 | 66 75 6e 63 74 69 6f 6e |es. The |function|
|00002760| 73 2c 20 77 68 69 63 68 | 20 61 72 65 20 64 65 73 |s, which| are des|
|00002770| 63 72 69 62 65 64 20 62 | 65 6c 6f 77 2c 20 64 6f |cribed b|elow, do|
|00002780| 20 69 74 2e 20 41 66 74 | 65 72 20 74 68 65 20 64 | it. Aft|er the d|
|00002790| 61 74 61 20 63 68 61 6e | 6e 65 6c 20 0a 74 6f 20 |ata chan|nel .to |
|000027a0| 61 20 72 65 6d 6f 74 65 | 20 66 69 6c 65 20 69 73 |a remote| file is|
|000027b0| 20 63 72 65 61 74 65 64 | 2c 20 69 74 20 62 65 63 | created|, it bec|
|000027c0| 6f 6d 65 73 20 70 6f 73 | 73 69 62 6c 65 20 74 6f |omes pos|sible to|
|000027d0| 20 72 65 61 64 20 61 6e | 64 20 77 72 69 74 65 20 | read an|d write |
|000027e0| 63 68 61 72 61 63 74 65 | 72 73 20 75 73 69 6e 67 |characte|rs using|
|000027f0| 20 73 74 61 6e 64 61 72 | 64 20 49 6e 70 75 74 2f | standar|d Input/|
|00002800| 4f 75 74 70 75 74 20 66 | 75 6e 63 74 69 6f 6e 73 |Output f|unctions|
|00002810| 2c 0a 6f 72 20 75 73 69 | 6e 67 20 73 70 65 63 69 |,.or usi|ng speci|
|00002820| 61 6c 20 66 75 6e 63 74 | 69 6f 6e 73 20 5c 74 73 |al funct|ions \ts|
|00002830| 7b 46 74 70 52 65 61 64 | 7d 2f 5c 74 73 7b 46 74 |{FtpRead|}/\ts{Ft|
|00002840| 70 57 72 69 74 65 7d 2c | 20 77 68 69 63 68 20 72 |pWrite},| which r|
|00002850| 65 6f 72 67 61 6e 69 7a | 65 20 73 74 72 65 61 6d |eorganiz|e stream|
|00002860| 20 66 6f 72 20 73 74 61 | 6e 64 61 72 64 20 74 65 | for sta|ndard te|
|00002870| 78 74 20 66 69 6c 65 2c | 20 0a 75 6e 64 65 72 20 |xt file,| .under |
|00002880| 63 6f 6e 64 69 74 69 6f | 6e 0a 74 68 61 74 20 74 |conditio|n.that t|
|00002890| 68 65 20 5c 74 73 7b 41 | 53 43 49 49 7d 20 6d 6f |he \ts{A|SCII} mo|
|000028a0| 64 65 20 69 73 20 73 65 | 74 2e 20 5c 66 6f 6f 74 |de is se|t. \foot|
|000028b0| 6e 6f 74 65 7b 4f 66 20 | 63 6f 75 72 73 65 2c 20 |note{Of |course, |
|000028c0| 73 75 63 68 20 66 75 6e | 63 74 69 6f 6e 73 20 61 |such fun|ctions a|
|000028d0| 73 20 5c 74 73 7b 73 65 | 65 6b 7d 2c 20 5c 74 73 |s \ts{se|ek}, \ts|
|000028e0| 7b 69 6f 63 74 6c 7d 2c | 20 2e 2e 2e 2e 20 0a 63 |{ioctl},| .... .c|
|000028f0| 61 6e 20 6e 6f 74 20 62 | 65 20 75 73 65 64 2e 7d |an not b|e used.}|
|00002900| 0a 0a 5c 74 74 74 7b 5c | 74 6f 69 6e 64 65 78 7b |..\ttt{\|toindex{|
|00002910| 46 74 70 44 61 74 61 7d | 28 46 54 50 7e 2a 2c 20 |FtpData}|(FTP~*, |
|00002920| 63 68 61 72 7e 2a 63 6f | 6d 6d 61 6e 64 2c 20 63 |char~*co|mmand, c|
|00002930| 68 61 72 7e 2a 70 61 72 | 61 6d 2c 20 63 68 61 72 |har~*par|am, char|
|00002940| 7e 2a 6d 6f 64 65 29 7d | 0a 7b 20 4d 61 6b 65 73 |~*mode)}|.{ Makes|
|00002950| 20 64 61 74 61 20 74 72 | 61 6e 73 66 65 72 20 63 | data tr|ansfer c|
|00002960| 68 61 6e 6e 65 6c 2c 20 | 77 69 74 68 20 70 72 65 |hannel, |with pre|
|00002970| 73 65 6e 64 69 6e 67 20 | 63 6f 6d 6d 61 6e 64 20 |sending |command |
|00002980| 63 6f 6d 70 6f 73 65 64 | 20 66 72 6f 6d 20 5c 74 |composed| from \t|
|00002990| 73 7b 63 6f 6d 6d 61 6e | 64 7d 20 61 6e 64 20 5c |s{comman|d} and \|
|000029a0| 74 73 7b 70 61 72 61 6d | 7d 2e 20 0a 54 68 65 20 |ts{param|}. .The |
|000029b0| 6d 6f 64 65 20 6d 75 73 | 74 20 62 65 20 5c 74 73 |mode mus|t be \ts|
|000029c0| 7b 60 60 72 27 27 7d 20 | 6f 72 20 5c 74 73 7b 60 |{``r''} |or \ts{`|
|000029d0| 60 77 27 27 7d 7d 0a 0a | 5c 74 74 74 7b 5c 74 6f |`w''}}..|\ttt{\to|
|000029e0| 69 6e 64 65 78 7b 46 74 | 70 4f 70 65 6e 52 65 61 |index{Ft|pOpenRea|
|000029f0| 64 7d 28 46 54 50 7e 2a | 2c 63 68 61 72 7e 2a 66 |d}(FTP~*|,char~*f|
|00002a00| 69 6c 65 6e 61 6d 65 29 | 7d 0a 7b 20 4f 70 65 6e |ilename)|}.{ Open|
|00002a10| 73 20 66 69 6c 65 20 6e | 61 6d 65 64 20 5c 74 73 |s file n|amed \ts|
|00002a20| 7b 66 69 6c 65 6e 61 6d | 65 7d 20 66 6f 72 20 72 |{filenam|e} for r|
|00002a30| 65 61 64 69 6e 67 20 6f | 6e 20 73 65 72 76 65 72 |eading o|n server|
|00002a40| 7d 0a 0a 5c 74 74 74 7b | 5c 74 6f 69 6e 64 65 78 |}..\ttt{|\toindex|
|00002a50| 7b 46 74 70 4f 70 65 6e | 57 72 69 74 65 7d 28 46 |{FtpOpen|Write}(F|
|00002a60| 54 50 7e 2a 2c 63 68 61 | 72 7e 2a 66 69 6c 65 6e |TP~*,cha|r~*filen|
|00002a70| 61 6d 65 29 7d 0a 7b 20 | 43 72 65 61 74 73 20 61 |ame)}.{ |Creats a|
|00002a80| 6e 64 20 6f 70 65 6e 73 | 20 66 69 6c 65 20 6e 61 |nd opens| file na|
|00002a90| 6d 65 64 20 5c 74 73 7b | 66 69 6c 65 6e 61 6d 65 |med \ts{|filename|
|00002aa0| 7d 20 66 6f 72 20 77 72 | 69 74 69 6e 67 20 6f 6e |} for wr|iting on|
|00002ab0| 20 73 65 72 76 65 72 7d | 0a 0a 5c 74 74 74 7b 5c | server}|..\ttt{\|
|00002ac0| 74 6f 69 6e 64 65 78 7b | 46 74 70 4f 70 65 6e 41 |toindex{|FtpOpenA|
|00002ad0| 70 70 65 6e 64 7d 28 46 | 54 50 7e 2a 2c 63 68 61 |ppend}(F|TP~*,cha|
|00002ae0| 72 7e 2a 66 69 6c 65 6e | 61 6d 65 29 7d 0a 7b 20 |r~*filen|ame)}.{ |
|00002af0| 43 72 65 61 74 73 20 61 | 6e 64 20 6f 70 65 6e 73 |Creats a|nd opens|
|00002b00| 20 66 69 6c 65 20 6e 61 | 6d 65 64 20 5c 74 73 7b | file na|med \ts{|
|00002b10| 66 69 6c 65 6e 61 6d 65 | 7d 20 66 6f 72 20 61 70 |filename|} for ap|
|00002b20| 70 65 6e 64 69 6e 67 20 | 6f 6e 20 73 65 72 76 65 |pending |on serve|
|00002b30| 72 7d 0a 0a 5c 74 74 74 | 7b 5c 74 6f 69 6e 64 65 |r}..\ttt|{\toinde|
|00002b40| 78 7b 46 74 70 4f 70 65 | 6e 44 69 72 7d 28 46 54 |x{FtpOpe|nDir}(FT|
|00002b50| 50 7e 2a 2c 20 63 68 61 | 72 7e 2a 66 69 6c 65 73 |P~*, cha|r~*files|
|00002b60| 29 7d 0a 7b 0a 20 20 43 | 72 65 61 74 73 20 63 68 |)}.{. C|reats ch|
|00002b70| 61 6e 6e 65 6c 20 66 6f | 72 20 64 69 72 65 63 74 |annel fo|r direct|
|00002b80| 6f 72 79 20 6c 69 73 74 | 20 72 65 61 64 69 6e 67 |ory list| reading|
|00002b90| 2c 20 64 65 73 63 72 69 | 62 65 64 20 62 79 20 61 |, descri|bed by a|
|00002ba0| 72 67 75 6d 65 6e 74 20 | 5c 74 73 7b 66 69 6c 65 |rgument |\ts{file|
|00002bb0| 73 7d 2e 0a 7d 0a 0a 5c | 74 74 74 7b 69 6e 74 20 |s}..}..\|ttt{int |
|00002bc0| 5c 74 6f 69 6e 64 65 78 | 7b 46 74 70 52 65 61 64 |\toindex|{FtpRead|
|00002bd0| 7d 28 46 54 50 7e 2a 29 | 7d 7b 0a 52 65 61 64 73 |}(FTP~*)|}{.Reads|
|00002be0| 20 63 68 61 72 61 63 74 | 65 72 20 66 72 6f 6d 20 | charact|er from |
|00002bf0| 64 61 74 61 20 73 74 72 | 65 61 6d 2e 20 49 66 20 |data str|eam. If |
|00002c00| 20 5c 74 73 7b 41 53 43 | 49 49 7d 20 6d 6f 64 65 | \ts{ASC|II} mode|
|00002c10| 20 69 73 20 73 65 74 5c | 66 6f 6f 74 6e 6f 74 65 | is set\|footnote|
|00002c20| 7b 42 79 20 64 65 66 61 | 75 6c 74 7d 20 63 6f 6e |{By defa|ult} con|
|00002c30| 76 65 72 74 73 20 6e 65 | 77 20 6c 69 6e 65 20 6d |verts ne|w line m|
|00002c40| 61 72 6b 65 72 73 2e 0a | 57 68 65 6e 20 74 68 65 |arkers..|When the|
|00002c50| 20 65 6e 64 20 6f 66 20 | 66 69 6c 65 20 69 73 20 | end of |file is |
|00002c60| 64 65 74 65 63 74 65 64 | 20 6f 72 20 63 68 61 6e |detected| or chan|
|00002c70| 6e 65 6c 20 69 73 20 62 | 72 6f 6b 65 6e 2c 20 72 |nel is b|roken, r|
|00002c80| 65 74 75 72 6e 73 20 5c | 74 6f 69 6e 64 65 78 7b |eturns \|toindex{|
|00002c90| 45 4f 46 7d 7d 0a 0a 5c | 74 74 74 7b 5c 74 6f 69 |EOF}}..\|ttt{\toi|
|00002ca0| 6e 64 65 78 7b 46 74 70 | 47 65 74 53 74 72 69 6e |ndex{Ftp|GetStrin|
|00002cb0| 67 7d 28 46 54 50 7e 2a | 2c 20 63 68 61 72 7e 2a |g}(FTP~*|, char~*|
|00002cc0| 73 74 72 29 7d 0a 7b 20 | 52 65 61 64 73 20 6f 6e |str)}.{ |Reads on|
|00002cd0| 65 20 73 74 72 69 6e 67 | 20 66 72 6f 6d 20 64 61 |e string| from da|
|00002ce0| 74 61 20 73 74 72 65 61 | 6d 20 75 73 69 6e 67 20 |ta strea|m using |
|00002cf0| 5c 74 73 7b 46 74 70 52 | 65 61 64 7d 7d 0a 0a 5c |\ts{FtpR|ead}}..\|
|00002d00| 74 74 74 7b 5c 74 6f 69 | 6e 64 65 78 7b 46 74 70 |ttt{\toi|ndex{Ftp|
|00002d10| 57 72 69 74 65 7d 28 46 | 54 50 7e 2a 2c 20 63 68 |Write}(F|TP~*, ch|
|00002d20| 61 72 7e 63 29 7d 7b 0a | 57 72 69 74 65 73 20 73 |ar~c)}{.|Writes s|
|00002d30| 69 6e 67 6c 65 20 63 68 | 61 72 61 63 74 65 72 20 |ingle ch|aracter |
|00002d40| 74 6f 20 73 74 72 65 61 | 6d 2c 20 69 66 20 5c 74 |to strea|m, if \t|
|00002d50| 73 7b 41 53 43 49 49 7d | 20 6d 6f 64 65 20 69 73 |s{ASCII}| mode is|
|00002d60| 20 73 65 74 20 63 6f 6e | 76 65 72 74 73 20 6e 65 | set con|verts ne|
|00002d70| 77 20 6c 69 6e 65 20 6d | 61 72 6b 65 72 73 2e 0a |w line m|arkers..|
|00002d80| 57 68 65 6e 20 63 68 61 | 6e 6e 65 6c 20 69 73 20 |When cha|nnel is |
|00002d90| 62 72 6f 6b 65 6e 2c 20 | 72 65 74 75 72 6e 73 20 |broken, |returns |
|00002da0| 5c 74 6f 69 6e 64 65 78 | 7b 45 4f 46 7d 7d 0a 0a |\toindex|{EOF}}..|
|00002db0| 5c 74 74 74 7b 5c 74 6f | 69 6e 64 65 78 7b 46 74 |\ttt{\to|index{Ft|
|00002dc0| 70 43 6c 6f 73 65 7d 28 | 46 54 50 7e 2a 29 7d 0a |pClose}(|FTP~*)}.|
|00002dd0| 7b 43 6c 6f 73 65 73 20 | 6f 70 65 6e 65 64 20 63 |{Closes |opened c|
|00002de0| 68 61 6e 6e 65 6c 20 74 | 6f 20 73 65 72 76 65 72 |hannel t|o server|
|00002df0| 7d 0a 0a 5c 73 65 63 74 | 69 6f 6e 7b 4f 74 68 65 |}..\sect|ion{Othe|
|00002e00| 72 20 63 6f 6d 6d 61 6e | 64 73 20 66 6f 72 20 73 |r comman|ds for s|
|00002e10| 65 72 76 65 72 7d 0a 0a | 5c 74 74 74 7b 5c 74 6f |erver}..|\ttt{\to|
|00002e20| 69 6e 64 65 78 7b 46 74 | 70 43 6f 6d 6d 61 6e 64 |index{Ft|pCommand|
|00002e30| 7d 28 46 54 50 7e 2a 2c | 20 63 68 61 72 7e 2a 63 |}(FTP~*,| char~*c|
|00002e40| 6f 6d 6d 61 6e 64 2c 20 | 63 68 61 72 7e 2a 70 61 |ommand, |char~*pa|
|00002e50| 72 61 6d 2c 20 69 6e 74 | 7e 6f 6b 31 2c 20 6f 6b |ram, int|~ok1, ok|
|00002e60| 32 2c 20 6f 6b 33 2c 20 | 2e 2e 2e 2c 20 6f 6b 4e |2, ok3, |..., okN|
|00002e70| 2c 20 45 4f 46 29 7d 0a | 7b 20 53 65 6e 64 73 20 |, EOF)}.|{ Sends |
|00002e80| 61 20 63 6f 6d 6d 61 6e | 64 2c 20 63 6f 6d 70 6f |a comman|d, compo|
|00002e90| 73 65 64 20 66 72 6f 6d | 20 5c 74 73 7b 63 6f 6d |sed from| \ts{com|
|00002ea0| 6d 61 6e 64 7d 20 61 6e | 64 20 5c 74 73 7b 70 61 |mand} an|d \ts{pa|
|00002eb0| 72 61 6d 7d 20 75 73 69 | 6e 67 20 5c 74 73 7b 73 |ram} usi|ng \ts{s|
|00002ec0| 70 72 69 6e 74 66 7d 20 | 66 75 6e 63 74 69 6f 6e |printf} |function|
|00002ed0| 2e 20 0a 52 65 61 64 73 | 20 61 6e 20 61 6e 73 77 |. .Reads| an answ|
|00002ee0| 65 72 20 66 72 6f 6d 20 | 74 68 65 20 73 65 72 76 |er from |the serv|
|00002ef0| 65 72 2e 20 0a 57 68 65 | 6e 20 72 65 74 75 72 6e |er. .Whe|n return|
|00002f00| 20 63 6f 64 65 20 66 72 | 6f 6d 20 74 68 65 20 73 | code fr|om the s|
|00002f10| 65 72 76 65 72 20 69 73 | 20 6e 6f 74 20 69 6e 63 |erver is| not inc|
|00002f20| 6c 75 64 65 64 20 74 6f | 20 5c 74 73 7b 6f 6b 2d |luded to| \ts{ok-|
|00002f30| 6c 69 73 74 7d 28 5c 74 | 73 7b 6f 6b 31 7d 2c 5c |list}(\t|s{ok1},\|
|00002f40| 74 73 7b 6f 6b 32 7d 2e | 2e 2e 29 20 74 68 65 20 |ts{ok2}.|..) the |
|00002f50| 73 69 67 6e 20 6f 66 20 | 63 6f 64 65 20 0a 77 69 |sign of |code .wi|
|00002f60| 6c 6c 20 62 65 20 20 69 | 6e 76 65 72 74 65 64 2e |ll be i|nverted.|
|00002f70| 7d 0a 7d 0a 0a 5c 74 74 | 74 7b 5c 74 6f 69 6e 64 |}.}..\tt|t{\toind|
|00002f80| 65 78 7b 46 74 70 54 79 | 70 65 7d 28 46 54 50 7e |ex{FtpTy|pe}(FTP~|
|00002f90| 2a 2c 63 68 61 72 7e 2a | 6d 6f 64 65 29 7d 0a 7b |*,char~*|mode)}.{|
|00002fa0| 53 65 74 73 20 74 72 61 | 6e 73 66 65 72 20 6d 6f |Sets tra|nsfer mo|
|00002fb0| 64 65 2c 20 73 75 63 68 | 20 61 73 20 5c 74 73 7b |de, such| as \ts{|
|00002fc0| 60 60 41 27 27 7d 2c 5c | 74 73 7b 27 27 49 27 27 |``A''},\|ts{''I''|
|00002fd0| 7d 2c 5c 74 73 7b 27 27 | 53 27 27 7d 7d 0a 0a 5c |},\ts{''|S''}}..\|
|00002fe0| 74 74 74 7b 5c 74 6f 69 | 6e 64 65 78 7b 46 74 70 |ttt{\toi|ndex{Ftp|
|00002ff0| 42 69 6e 61 72 79 7d 28 | 46 54 50 7e 2a 29 7d 0a |Binary}(|FTP~*)}.|
|00003000| 7b 53 65 74 73 20 62 69 | 6e 61 72 79 20 6d 6f 64 |{Sets bi|nary mod|
|00003010| 65 7d 0a 0a 5c 74 74 74 | 7b 5c 74 6f 69 6e 64 65 |e}..\ttt|{\toinde|
|00003020| 78 7b 46 74 70 41 73 63 | 69 69 7d 28 46 54 50 7e |x{FtpAsc|ii}(FTP~|
|00003030| 2a 29 7d 0a 7b 53 65 74 | 73 20 5c 74 73 7b 41 53 |*)}.{Set|s \ts{AS|
|00003040| 43 49 49 7d 20 6d 6f 64 | 65 7d 0a 0a 0a 5c 74 74 |CII} mod|e}...\tt|
|00003050| 74 7b 5c 74 6f 69 6e 64 | 65 78 7b 46 74 70 4d 6b |t{\toind|ex{FtpMk|
|00003060| 64 69 72 7d 28 46 54 50 | 7e 2a 2c 63 68 61 72 20 |dir}(FTP|~*,char |
|00003070| 2a 64 69 72 6e 61 6d 65 | 29 7d 0a 7b 4d 61 6b 65 |*dirname|)}.{Make|
|00003080| 73 20 20 64 69 72 65 63 | 74 6f 72 79 20 6f 6e 20 |s direc|tory on |
|00003090| 73 65 72 76 65 72 7d 0a | 0a 5c 74 74 74 7b 5c 74 |server}.|.\ttt{\t|
|000030a0| 6f 69 6e 64 65 78 7b 46 | 74 70 43 68 64 69 72 7d |oindex{F|tpChdir}|
|000030b0| 28 46 54 50 7e 2a 2c 63 | 68 61 72 20 2a 64 69 72 |(FTP~*,c|har *dir|
|000030c0| 6e 61 6d 65 29 7d 0a 7b | 43 68 61 6e 67 65 73 20 |name)}.{|Changes |
|000030d0| 77 6f 72 6b 69 6e 67 20 | 64 69 72 65 63 74 6f 72 |working |director|
|000030e0| 79 20 6f 6e 20 73 65 72 | 76 65 72 7d 0a 0a 5c 74 |y on ser|ver}..\t|
|000030f0| 74 74 7b 5c 74 6f 69 6e | 64 65 78 7b 46 74 70 52 |tt{\toin|dex{FtpR|
|00003100| 6d 7d 28 46 54 50 7e 2a | 2c 63 68 61 72 20 2a 66 |m}(FTP~*|,char *f|
|00003110| 69 6c 65 6e 61 6d 65 29 | 7d 0a 7b 52 65 6d 6f 76 |ilename)|}.{Remov|
|00003120| 65 73 20 66 69 6c 65 20 | 6f 6e 20 73 65 72 76 65 |es file |on serve|
|00003130| 72 7d 0a 0a 5c 74 74 74 | 7b 63 68 61 72 7e 2a 5c |r}..\ttt|{char~*\|
|00003140| 74 6f 69 6e 64 65 78 7b | 46 74 70 50 77 64 7d 28 |toindex{|FtpPwd}(|
|00003150| 46 54 50 7e 2a 29 7d 0a | 7b 52 65 74 75 72 6e 73 |FTP~*)}.|{Returns|
|00003160| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 20 77 6f 72 | the nam|e of wor|
|00003170| 6b 69 6e 67 20 64 69 72 | 65 63 74 6f 72 79 20 6f |king dir|ectory o|
|00003180| 6e 20 73 65 72 76 65 72 | 7d 0a 0a 5c 74 74 74 7b |n server|}..\ttt{|
|00003190| 5c 74 6f 69 6e 64 65 78 | 7b 46 74 70 4d 6f 76 65 |\toindex|{FtpMove|
|000031a0| 7d 28 46 54 50 7e 2a 2c | 63 68 61 72 20 2a 6f 6c |}(FTP~*,|char *ol|
|000031b0| 64 66 69 6c 65 6e 61 6d | 65 2c 20 63 68 61 72 20 |dfilenam|e, char |
|000031c0| 2a 6e 65 77 66 69 6c 65 | 6e 61 6d 65 29 7d 0a 7b |*newfile|name)}.{|
|000031d0| 52 65 6e 61 6d 65 73 20 | 66 69 6c 65 20 66 72 6f |Renames |file fro|
|000031e0| 6d 20 5c 74 73 7b 6f 6c | 64 66 69 6c 65 6e 61 6d |m \ts{ol|dfilenam|
|000031f0| 65 7d 20 74 6f 20 5c 74 | 73 7b 6e 65 77 66 69 6c |e} to \t|s{newfil|
|00003200| 65 6e 61 6d 65 7d 7d 0a | 0a 5c 74 74 74 7b 5c 74 |ename}}.|.\ttt{\t|
|00003210| 6f 69 6e 64 65 78 7b 46 | 74 70 47 65 74 46 69 6c |oindex{F|tpGetFil|
|00003220| 65 7d 28 46 54 50 7e 2a | 2c 63 68 61 72 20 2a 66 |e}(FTP~*|,char *f|
|00003230| 69 6c 65 6e 61 6d 65 29 | 7d 0a 7b 53 65 6e 64 73 |ilename)|}.{Sends|
|00003240| 20 73 74 61 72 74 20 74 | 72 61 6e 73 66 65 72 20 | start t|ransfer |
|00003250| 66 69 6c 65 20 63 6f 6d | 6d 61 6e 64 20 74 6f 20 |file com|mand to |
|00003260| 73 65 72 76 65 72 2e 20 | 44 6f 65 73 20 6e 6f 74 |server. |Does not|
|00003270| 20 6d 61 6b 65 20 64 61 | 74 61 20 63 68 61 6e 6e | make da|ta chann|
|00003280| 65 6c 7d 0a 0a 5c 74 74 | 74 7b 5c 74 6f 69 6e 64 |el}..\tt|t{\toind|
|00003290| 65 78 7b 46 74 70 50 75 | 74 46 69 6c 65 7d 28 46 |ex{FtpPu|tFile}(F|
|000032a0| 54 50 7e 2a 2c 63 68 61 | 72 20 2a 66 69 6c 65 6e |TP~*,cha|r *filen|
|000032b0| 61 6d 65 29 7d 0a 7b 53 | 65 6e 64 73 20 73 74 61 |ame)}.{S|ends sta|
|000032c0| 72 74 20 74 72 61 6e 73 | 66 65 72 20 66 69 6c 65 |rt trans|fer file|
|000032d0| 20 63 6f 6d 6d 61 6e 64 | 20 74 6f 20 74 68 65 20 | command| to the |
|000032e0| 73 65 72 76 65 72 2e 20 | 44 6f 65 73 20 6e 6f 74 |server. |Does not|
|000032f0| 20 6d 61 6b 65 20 64 61 | 74 61 20 63 68 61 6e 6e | make da|ta chann|
|00003300| 65 6c 7d 0a 0a 5c 74 74 | 74 7b 5c 74 6f 69 6e 64 |el}..\tt|t{\toind|
|00003310| 65 78 7b 46 74 70 50 6f | 72 74 7d 28 46 54 50 7e |ex{FtpPo|rt}(FTP~|
|00003320| 2a 2c 20 69 6e 74 7e 61 | 2c 20 69 6e 74 7e 62 2c |*, int~a|, int~b,|
|00003330| 20 69 6e 74 7e 63 2c 20 | 69 6e 74 7e 64 2c 20 69 | int~c, |int~d, i|
|00003340| 6e 74 7e 65 2c 20 69 6e | 74 7e 66 29 7d 0a 7b 20 |nt~e, in|t~f)}.{ |
|00003350| 41 20 63 6f 6d 6d 61 6e | 64 20 66 6f 72 20 74 68 |A comman|d for th|
|00003360| 65 20 73 65 72 76 65 72 | 20 66 6f 72 20 6d 61 6b |e server| for mak|
|00003370| 69 6e 67 20 61 20 6e 65 | 77 20 64 61 74 61 20 63 |ing a ne|w data c|
|00003380| 68 61 6e 6e 65 6c 2e 20 | 5c 74 73 7b 61 2e 62 2e |hannel. |\ts{a.b.|
|00003390| 63 2e 64 7d 20 69 73 20 | 61 6e 20 49 50 20 61 64 |c.d} is |an IP ad|
|000033a0| 64 72 65 73 73 20 6f 66 | 20 61 20 63 6c 69 65 6e |dress of| a clien|
|000033b0| 74 28 69 2e 65 2e 20 79 | 6f 75 72 20 49 50 20 61 |t(i.e. y|our IP a|
|000033c0| 64 64 72 65 73 73 29 2c | 20 0a 5c 74 73 7b 65 2a |ddress),| .\ts{e*|
|000033d0| 32 35 36 2b 66 7d 20 69 | 73 20 61 20 70 6f 72 74 |256+f} i|s a port|
|000033e0| 20 6e 75 6d 62 65 72 7d | 0a 0a 5c 73 65 63 74 69 | number}|..\secti|
|000033f0| 6f 6e 7b 53 75 62 70 72 | 6f 67 72 61 6d 73 20 66 |on{Subpr|ograms f|
|00003400| 6f 72 20 73 65 6e 64 69 | 6e 67 2f 72 65 63 65 69 |or sendi|ng/recei|
|00003410| 76 69 6e 67 20 63 6f 6e | 74 72 6f 6c 20 6d 65 73 |ving con|trol mes|
|00003420| 73 61 67 65 73 20 74 6f | 2f 66 72 6f 6d 20 73 65 |sages to|/from se|
|00003430| 72 76 65 72 7d 0a 0a 5c | 74 74 74 7b 5c 74 6f 69 |rver}..\|ttt{\toi|
|00003440| 6e 64 65 78 7b 46 74 70 | 53 65 6e 64 4d 65 73 73 |ndex{Ftp|SendMess|
|00003450| 61 67 65 7d 28 46 54 50 | 7e 2a 2c 20 63 68 61 72 |age}(FTP|~*, char|
|00003460| 7e 2a 6d 65 73 73 61 67 | 65 29 7d 0a 7b 53 65 6e |~*messag|e)}.{Sen|
|00003470| 64 73 20 61 20 6d 65 73 | 73 61 67 65 20 74 6f 20 |ds a mes|sage to |
|00003480| 74 68 65 20 73 65 72 76 | 65 72 7d 0a 0a 5c 74 74 |the serv|er}..\tt|
|00003490| 74 7b 69 6e 74 20 5c 74 | 6f 69 6e 64 65 78 7b 46 |t{int \t|oindex{F|
|000034a0| 74 70 47 65 74 4d 65 73 | 73 61 67 65 7d 28 46 54 |tpGetMes|sage}(FT|
|000034b0| 50 7e 2a 29 7d 0a 7b 52 | 65 63 65 69 76 65 73 20 |P~*)}.{R|eceives |
|000034c0| 61 20 6d 65 73 73 61 67 | 65 20 66 72 6f 6d 20 74 |a messag|e from t|
|000034d0| 68 65 20 73 65 72 76 65 | 72 2e 7d 0a 0a 5c 74 74 |he serve|r.}..\tt|
|000034e0| 74 7b 5c 74 6f 69 6e 64 | 65 78 7b 46 74 70 4d 65 |t{\toind|ex{FtpMe|
|000034f0| 73 73 61 67 65 7d 28 69 | 6e 74 20 4e 75 6d 62 65 |ssage}(i|nt Numbe|
|00003500| 72 29 7d 0a 7b 47 65 74 | 73 20 61 20 6d 65 73 73 |r)}.{Get|s a mess|
|00003510| 61 67 65 20 62 79 20 63 | 6f 64 65 2e 7d 0a 0a 5c |age by c|ode.}..\|
|00003520| 73 65 63 74 69 6f 6e 7b | 48 69 67 68 2d 6c 65 76 |section{|High-lev|
|00003530| 65 6c 20 66 75 6e 63 74 | 69 6f 6e 73 7d 0a 0a 5c |el funct|ions}..\|
|00003540| 74 74 74 7b 46 49 4c 45 | 20 2a 5c 74 6f 69 6e 64 |ttt{FILE| *\toind|
|00003550| 65 78 7b 46 74 70 46 75 | 6c 6c 4f 70 65 6e 7d 28 |ex{FtpFu|llOpen}(|
|00003560| 63 68 61 72 20 2a 66 69 | 6c 65 6e 61 6d 65 2c 63 |char *fi|lename,c|
|00003570| 68 61 72 20 2a 6d 6f 64 | 65 29 7d 0a 7b 20 20 0a |har *mod|e)}.{ .|
|00003580| 50 61 72 73 65 73 20 73 | 74 72 69 6e 67 20 5c 74 |Parses s|tring \t|
|00003590| 73 7b 66 69 6c 65 6e 61 | 6d 65 7d 2c 20 77 68 69 |s{filena|me}, whi|
|000035a0| 63 68 20 6d 75 73 74 20 | 63 6f 6e 74 61 69 6e 20 |ch must |contain |
|000035b0| 61 20 73 74 72 69 6e 67 | 20 69 6e 20 66 6f 72 6d |a string| in form|
|000035c0| 61 74 20 6f 72 20 5c 5c | 0a 5c 74 73 7b 68 6f 73 |at or \\|.\ts{hos|
|000035d0| 74 2f 75 73 65 72 2f 70 | 61 73 73 77 6f 72 64 3a |t/user/p|assword:|
|000035e0| 66 69 6c 65 6e 61 6d 65 | 7d 20 6f 72 20 5c 74 73 |filename|} or \ts|
|000035f0| 7b 66 69 6c 65 6e 61 6d | 65 7d 2c 0a 77 68 61 74 |{filenam|e},.what|
|00003600| 20 63 6f 72 72 65 73 70 | 6f 6e 64 73 20 74 6f 20 | corresp|onds to |
|00003610| 72 65 6d 6f 74 65 20 6f | 72 20 6c 6f 63 61 6c 20 |remote o|r local |
|00003620| 66 69 6c 65 2e 20 54 68 | 65 20 73 65 63 6f 6e 64 |file. Th|e second|
|00003630| 20 61 72 67 75 6d 65 6e | 74 20 69 73 20 74 68 65 | argumen|t is the|
|00003640| 20 74 79 70 65 20 6f 66 | 20 6f 70 65 6e 69 6e 67 | type of| opening|
|00003650| 2c 20 64 69 76 69 64 65 | 64 20 69 6e 74 6f 20 74 |, divide|d into t|
|00003660| 77 6f 20 63 68 61 72 61 | 63 74 65 72 73 3a 20 0a |wo chara|cters: .|
|00003670| 66 69 72 73 74 20 2d 2d | 2d 20 74 68 65 20 6d 6f |first --|- the mo|
|00003680| 64 65 20 6f 66 20 6f 70 | 65 6e 69 6e 67 20 5c 74 |de of op|ening \t|
|00003690| 73 7b 60 60 72 27 27 7d | 2c 20 5c 74 73 7b 60 60 |s{``r''}|, \ts{``|
|000036a0| 77 27 27 7d 20 6f 72 20 | 5c 74 73 7b 60 60 61 27 |w''} or |\ts{``a'|
|000036b0| 27 7d 2c 20 73 65 63 6f | 6e 64 20 69 73 20 74 68 |'}, seco|nd is th|
|000036c0| 65 20 74 72 61 6e 73 66 | 65 72 20 74 79 70 65 20 |e transf|er type |
|000036d0| 2c 20 69 66 20 63 6f 6e | 74 61 69 6e 73 20 63 68 |, if con|tains ch|
|000036e0| 61 72 61 63 74 65 72 20 | 5c 74 73 7b 60 60 62 27 |aracter |\ts{``b'|
|000036f0| 27 7d 2c 0a 20 74 68 65 | 6e 20 74 68 65 20 6d 6f |'},. the|n the mo|
|00003700| 64 65 20 69 73 20 62 69 | 6e 61 72 79 2e 0a 7d 0a |de is bi|nary..}.|
|00003710| 0a 5c 74 74 74 7b 53 54 | 41 54 55 53 20 46 74 70 |.\ttt{ST|ATUS Ftp|
|00003720| 46 75 6c 6c 43 6c 6f 73 | 65 28 46 49 4c 45 20 2a |FullClos|e(FILE *|
|00003730| 73 74 72 65 61 6d 29 7d | 0a 7b 43 6c 6f 73 65 73 |stream)}|.{Closes|
|00003740| 20 61 6e 20 6f 70 65 6e | 65 64 20 66 69 6c 65 7d | an open|ed file}|
|00003750| 0a 0a 5c 6e 65 77 70 61 | 67 65 0a 5c 69 6e 70 75 |..\newpa|ge.\inpu|
|00003760| 74 20 72 75 73 2e 69 6e | 64 0a 5c 6e 65 77 70 61 |t rus.in|d.\newpa|
|00003770| 67 65 0a 5c 74 61 62 6c | 65 6f 66 63 6f 6e 74 65 |ge.\tabl|eofconte|
|00003780| 6e 74 73 0a 5c 65 6e 64 | 7b 64 6f 63 75 6d 65 6e |nts.\end|{documen|
|00003790| 74 7d 0a 0a | |t}.. | |
+--------+-------------------------+-------------------------+--------+--------+